Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Qemu how to get a port for VNC and stop the terminal?

Using Ubuntu 20.04, I am starting my Ubuntu server with:

qemu-system-x86_64 \
  -enable-kvm \
  -cpu host \
  -smp 11 \
  -drive format=raw,file=/mnt/kvm-guests/work.img,if=virtio \
  -net nic,model=virtio,macaddr=ec:8d:2c:f3:2a:7c \
  -net tap,ifname=tap2,script=no,downscript=no \
  -runas kvmuser \
  -nographic \
  -m 30000 &

How do I make it to where:

  1. There is a port given in the output if I want to vnc into it
  2. Not have the terminal be used as a display (I don’t want a terminal at all)

Using Qemu version 4.2.1 along with KVM

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

for the cli configuration of a VNC you need to configure the display that way.
To do that drop "nographic" and instead add something like -display none -vnc :0.

Of these options -display none makes it not put output somewhere immediately, but in comparison to nographic it will leave a virtual gpu present to the guest. Then -vnc controls where/how to open a port. There are many suboptions, and I’d recommend to restrict accessibility and authentication. You can aslo combine it with spice, so I’d recommend to have a look for "vnc" in the man page

-display none of the above will already have done that for you, for full background execution consider also adding-daemonize

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading