Desperatly need help setting up headless UBUNTU vm server

I have a headless ubuntu 18.04 server running as my nas and want to setup several vms. The issue is every guide I have used doesnt work. I can ssh into my machine and start installing a vm using :

sudo virt-install --name Ubuntu-18.04 --ram=4096 --vcpus=4 --cpu host --hvm --disk path=/var/lib/libvirt/images/ubuntu-18.04-vm1,size=40 --cdrom /mnt/storage/ISOs/ubuntu-desktop.iso --graphics vnc

This only yields it starting to install but hangs on “waiting for installation to complete” I have no way to connect to the instance and finish the install. All guides just show the sample output as installed and restarted. Also how do I connect the vm to my network as another computer? I setup netplan to have a bridge so it should be all set. I’m willing to chat live with anyhting who can help. Thank you.

Also before everyone jumps on the search ban waggon I’ve been searching and trying everything for a month now. NO GUIDES HELP.

You should be able to connect to it with a vnc client on your desktop. You will have to find what ip your router gave it. Can’t remember if there is a port number

1 Like

There is also virt-manager if you are on a Linux desktop. I believe it is not being maintained anymore but should work for your purposes at the moment.

1 Like

I use virt-manager on my desktop and I haven’t had any issues connecting to VMs locally or on my server, but if you want to ssh and use virtsh/virt-install I always have to add --extra-args='console=ttyS0' to create a virtual serial device to connect to the console.

I would try:

sudo virt-install --name Ubuntu-18.04 \
--ram=4096 \
--vcpus=4 \
--cpu host \
--hvm \
--disk path=/var/lib/libvirt/images/ubuntu-18.04-vm1,size=40 \
--cdrom /mnt/storage/ISOs/ubuntu-desktop.iso \
--graphics vnc \
--extra-args='console=ttyS0'
1 Like

the problem with all of these is the host os is ubuntu server so there is no desktop and I can’t connect to the guest machine because the vm gets it’s ip from the virtio bridge so it has a seperate ip than anything else on the real network. Even though the vm is bridged it acts like it’s NATed

The extra args only works with location so it didn’t work.

Just for clarity my setup is ass follows:

Router
[ Desktop - windows 10 , Server - headless ubuntu 18.04 , various tvs etc ]

Just trying to get an instance of desktop ubuntu running in a vm so i can connect with windows pc and use the vm. In the future I’ll be hooking up raspberry pis that connect to various vms for the kids to use as systems that will connect to their own vm like a private cisco network

That is true… You could mount the ISO somewhere and then specify that with --location then use --extra-args but that does seem to be janky, especially since they deprecated the --serial option

Maybe install VirtualBox on your Desktop and see if you can connect to the Server? Then you could graphically install the Ubuntu Desktop

but this being a vm should just show the screen when connected and continue the install from there the issue is i cant connect also all vnc ports and kvm ports are open on host ufw

tried virtual box as well and cant connect either.

Leave off the --graphics part, and virt-install should attach to a tty console

Ok so I “installed” the vm again but running the commands in op and when I grep for the port I get this:

sudo virsh dumpxml Ubuntu-18.04 | grep vnc

graphics type=‘vnc’ socket=’/var/lib/libvirt/qemu/domain-8-Ubuntu-18.04/vn .sock’
listen type=‘socket’ socket=’/var/lib/libvirt/qemu/domain-8-Ubuntu-18.04 vnc.sock’/

but how would I install the os with out graphics?

text mode installer, it’s not that bad

Just tried without any graphics option and same results, just hangs on waiting for install to complete also says no console to launch for guest defaulting to --wait -1

from the ubuntu docs:
–graphics none --console pty,target_type=sclp

they’re also showing a line specifying a kernel and initrd image
–boot kernel=/var/lib/libvirt/images/kernel.ubuntu,initrd=/var/lib/libvirt/images/initrd.ubuntu \

graphics none is not allowed

is the host OS a different processor platform? maybe this would make things easier

docker run -it ubuntu:latest

it looks like I’m logged into the docker image but no clue what I would do from here. there are no graphics. I’m trying to install a vm (or docker image) with ubuntu desktop on my headless ubuntu server

You dont need a desktop to use VNC for the ubuntu server install

should just be able to look up what IP it got handed and use that + 5900 or 5901 possibly.

1 Like