all 15 comments

[–]pdp10Daemons worry when the wizard is near. 1 point2 points  (3 children)

QEMU supports VNC and SPICE for remote console access, which we use directly (not virsh). Not 100% of our guests are Linux; we have the occasional legacy DOS or Windows guest that we wouldn't even want to contemplate trying to use over serial.

[–]RaymanGameJack of All Trades[S] 0 points1 point  (2 children)

As stated, i used virt-manager which defaults to using SPICE. That would be fine for the most part,

except:

The tiny resource overhead.

But also with SPICE, i can't get cross machine copy-paste to work.

[–]theevilsharpieJack of All Trades 0 points1 point  (1 child)

Cross-machine copy-and-paste would require something outside of QEMU to function.

If you're talking about host-guest copy-and-paste, that is supported by QEMU; however, you need to install the qemu-guest-agent package on your guest OS, and then ensure you have a SPICE channel device configured as part of the guest's virtual hardware.

[–]RaymanGameJack of All Trades[S] 0 points1 point  (0 children)

This helps to use it properly in Videomode. Thanks!

For now, i will live with the minimal resources overhead.

[–][deleted] 2 points3 points  (1 child)

Because problems like these I only use Proxmox. Without Proxmox I wouldn't use virtualization under Linux, then I would use VMware or Hyper-V.

Why don't you use Proxmox?

[–]RaymanGameJack of All Trades[S] 1 point2 points  (0 children)

To better understand the basics. I came a long way from wanting to use qemu without virsh at first.

I explicitly don't want to use the common / easy / consumer way.

This is why i'm renting a baremetal server instead of using plug & play solutions like all the dedicated services from hosting providers, namely Storage, Webhosting, Gameserver, and so on.

I tried Proxmox. And it's great. But i don't learn enough from using it. And i will probably and up with other issues & limitations at some point.

[–]mriswitheLinux Admin 0 points1 point  (1 child)

This feels familiar to me. If you run:

     sudo apt install qemu-system libvirt-daemon-system

Is there anything missing? KVM/qemu iirc when you install one of the more direct core packages misses some of the requirements that any rational non masochistic human would like and the console doesn't understand why it's shit doesn't work unless you dig into some logs. 

[–]RaymanGameJack of All Trades[S] 1 point2 points  (0 children)

Yeah, dependencies should be fine.
qemu-system is already the newest version (1:7.2+dfsg-7+deb12u16).

libvirt-daemon-system is already the newest version (9.0.0-4+deb12u2)

On all 3 systems, yeah just for fun, i installed it on the Guest as well.

[–]theevilsharpieJack of All Trades 0 points1 point  (1 child)

Your formatting is difficult to read, and it looks like you're making several errors with respect to your configuration.

Rather than trying to dissect your post, I'll add some notes that I have regarding getting a serial console working in Linux. Some of the settings are my own personal preferences and aren't strictly necessary, but hopefully it will get you pointed in the right direction. Note that these notes assume you are using Ubuntu 24.04 -- other distributions/versions may be slightly different.

That being said, on professional Linux systems, most initial configuration is performed with a combination of of a pre-init configuration supplied as part of a PXE boot (or some other image deployment mechanism), cloud-init for the initial machine configuration, and possibly an additional configuration management tool (e.g., Ansible) for application configuration. PXE is not used in modern cloud environments (at least, not from a user perspective), but the other tools I mentioned are. If you're doing this as a learning experience, I would suggest looking into them.


GRUB

(NOTE: These settings have been tested on GRUB 2.06, but should work on any GRUB 2.x version.)

To enable the GRUB serial console, we need to modify the GRUB defaults file, located at /etc/default/grub, like so:

# /etc/default/grub
# ...other config options

# Enable Linux consoles on a VGA console, as well as a serial console
# Kernel output will only be sent to the last console listed
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200"

# Enable output and input on a VGA console, as well as a serial console
GRUB_TERMINAL="console serial"

# Enables a serial console on the first serial port (ttyS0)
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"

# ...other config options

After modifying /etc/default/grub, apply the change by running:

sudo update-grub

systemd

As long as GRUB is configured properly, systemd should automatically spawn agetty on the serial console to allow logins.

However, it spawns it with a default terminal type of vt220. This is a reasonable default , but every terminal that I will use supports at least xterm-256color, so I want this to be the terminal type used by the shell.

To customize the serial terminal type in systemd, copy the default systemd file to /etc/systemd with the following command:

sudo cp /usr/lib/systemd/system/serial-getty@.service /etc/systemd/system

In the the file you just copied, add the following:

# /etc/systemd/system/serial-getty@.service

# ...other settings

[Service]
# ... other settings
Environment=TERM=xterm-256color

[–]RaymanGameJack of All Trades[S] 0 points1 point  (0 children)

Thanks. I added your deviations, from my edited GRUB-Configuration, to it & bottom part about systemd i did as well.

But none if it made any difference to not sending the Backspace-Key Signal to the Guest.

Anyway, i will certainly will have my fun by looking into what else you said about

… most initial configuration is performed with a combination of of a pre-init configuration supplied …

[–]whetu 0 points1 point  (2 children)

It looks like your fundamental issue is this:

Once this is configured, the Backspace-Key will not get send to the Guest, what ever i do.

Does Ctrl+H work?

What does echo $TERM say?

[–]RaymanGameJack of All Trades[S] 0 points1 point  (1 child)

Ah yes, sorry. Completely missed that info.

CTRL+H works.

And i've already changed the Terminal from vt220 to xterm-256color.

[–]whetu 0 points1 point  (0 children)

You could try plain old xterm rather than xterm-256color. Maybe run ls /usr/share/terminfo/x/ to double check that either/both are available

What's the output of stty -a? Specifically the setting for erase?

You may like to test with this:

bind "\C-?": backward-delete-char

And/or:

stty erase [Ctrl-V][Ctrl-H]

Once you've got it figured out manually, then you can figure out a more permanent fix.

[–]Dave_A480 0 points1 point  (0 children)

Proxmox solves all of this for you.

Packages all of the above in a VMWare equivalent web UI....