1

I'm trying to use QEMU to install a virtual machine of Ubuntu 16.04 on my Ubuntu server. My server has no desktop and I work on it through ssh. So I need to be able to use QEMU remotely without desktop.

Here is what I've executed:

qemu-img create Ubuntu16.04.qcow2 5G
qemu-system-x86_64 -cdrom /home/me/ubuntu-16.04.3-server-amd64.iso -hda Ubuntu16.04.qcow2 -boot d -net nic -net user -m 1024 -localtime - curses

However, after executing the commands above, I get such an output on my ssh-terminal: enter image description here

It seems that it needs a desktop to continue, I'm not sure.

Also, I tried the commend:

qemu-system-x86_64 -cdrom /home/me/ubuntu-16.04.3-server-amd64.iso -hda Ubuntu16.04.qcow2 -boot d -net nic -net user -m 1024 -localtime -nographic

But it blocks here:

me@mymachine:~$ qemu-system-x86_64 -cdrom /home/zyh/ubuntu-16.04.3-server-amd64.iso -hda Ubuntu16.04.qcow2 -boot d -net nic -net user -m 1024 -localtime -nographic
WARNING: Image format was not specified for 'Ubuntu16.04.qcow2' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
  • I would prefer xen or kvm than qemu. – Rui F Ribeiro Mar 21 '18 at 10:28
  • Can't try it myself now, so just a comment: Doesn't -display none, or -nographic, or -curses work? See man page for details. – dirkt Mar 21 '18 at 10:47
  • @dirkt I can't get it to work with those optoins. -curses gives exactly what the OP screenshoted, -nographic gives nothing on terminal, I believe due to missing terminal=ttyS0 due to missing kernel CLI: askubuntu.com/questions/1108334/… – Ciro Santilli 新疆改造中心996ICU六四事件 Jan 9 at 16:14
2

To run QEMU remotely, your best option is to use its VNC support; this will disable its SDL window display, and allow you to connect to the graphical display remotely. Use the -vnc option with a target display (e.g. -vnc :0 to listen on port 5900 and allow connections from anywhere). If you’re not using a US English keyboard, you’ll also need to specify the keyboard layout with the -k option.

This also works with KVM if you’d rather use that. (KVM uses QEMU for its I/O.) Xen supports VNC too.

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.