3

I launch Qemu in test console:

% qemu-system-x86_64 -cpu host -boot c -hda fedora.qcow2 -snapshot -m 1024 --enable-kvm -name vm0 -curses -pidfile /var/run/vm0.pid -net none -netdev type=tap,id=net0,script=no,downscript=no,ifname=vhost0,vhost=on -device virtio-net-pci,netdev=net0

And it starts booting the kernel, I see messages, however it hangs shortly and all I see on the screen is "1280x1024 Graphic mode" in the center. I don't want any graphics, so I even updated grub.cfg on the guest and replaced 'rhgb' with 'text'.

Also in the guest:

% ls -la /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 37 Sep 22 17:17 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target
%

What else should I do to run it in purely text mode?

1

You want to configure your guest to send the console to the serial port.

With grub: $EDITOR /etc/default/grub

GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial"
GRUB_CMDLINE_LINUX="console=ttyS0 ..."

The regenerate grub's config with grub-mkconfig

grub2-mkconfig -o /boot/grub2/grub.cfg

Once the guest is configured properly. you change your qemu command to:

qemu-system-x86_64 -cpu host -boot c -hda fedora.qcow2 \
 -snapshot -m 1024 --enable-kvm -name vm0 \
 -pidfile /var/run/vm0.pid -net none \
 -netdev type=tap,id=net0,script=no,downscript=no,ifname=vhost0,vhost=on \
 -device virtio-net-pci,netdev=net0 -nographic

Which will use the current terminal for the serial console and qemu monitor console.

If don't want the qemu's monitor console, you can replace -nographic with -serial stdio

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.