I'm trying to install Windows 10 with virt-install on my Ubuntu Server LTS 20.04
. I'm not really an expert on virtualization, but I try installing with:
$ virt-install --name=windows10 --vcpus=4 --memory=8192\
--cdrom=/mnt/data/iso/Win10_20H2_v2_EnglishInternational_x64.iso\
--disk /mnt/data/vm-images/win10-vm,size=50,format=qcow2,bus=virtio\
--network bridge=br0,model=virtio --os-type=win10 --os-variant=win10\
--graphics vnc
But get the following warning, and it hangs at the Waiting for installation to complete.
(probably because I need to access Windows GUI to actually install?).
WARNING Graphics requested but DISPLAY is not set. Not running virt-viewer.
WARNING No console to launch for the guest, defaulting to --wait -1
Starting install...
Allocating 'win10-vm' | 50 GB 00:00:06
Domain installation still in progress.
Waiting for installation to complete.
I have a VNC client on my MacBook (TigerVNC 1.11.0 on macOS Big Sur), but I can't connect. A bit of searching tells me something about virt-install not finding a display (since no display is connected to the Ubuntu machine?), and something about X-forwarding in SSH, but I couldn't find a clear guide. Guides I could find all either use GUI on Linux machine, using virt-manager
, or install VMs that only need SSH access. But I did this when I was testing oVirt on CentOS (headless) so I know it should be possible, but I can't figure out how to do from CLI (via SSH).
Could anyone point me to a (thorough, since I'm quite new at this) guide for how to install a VM that needs VNC access on a headless machine that I access via SSH?