Running virtual machines with LXD 4.0

So I did another test with Ubuntu 20.04.1 LTS but on a new Hyper-V VM and I still got the same error. I don’t know what do to tbh

And the ISO you’re using is just a clean download from https://www.microsoft.com/en-ca/software-download/windows10 ?

Yes I downloaded the windows download tool from the Microsoft website then selected to just download the iso.

Can you try with the ISO from the link I posted?

That’s what we use for distrobuilder testing, that’s what I use myself and that’s what @simos used. It’s a straight ISO download link, there is no download tool involved at all, so it may be different from what you used.

For some reason it won’t let me go to the ISO link it keeps taking me to the tool.

Edit: Downloading the ISO now, it detects if you’re using a Windows OS then it gives you the tool so I change my user-agent to linux and I’m downloading the ISO now.

Alright so the direct ISO worked for some reason so thank you. Is there any way I could get this to work with the server version of Windows? Also genisoimage needs to be installed using apt-get.

@monstermunchkin told me that he had it working with Windows Server too, not sure what release though, but I’d expect it to similarly rely on direct .iso downloads from the Microsoft website.

I’ve pushed a commit which adds a check for genisoimage too, thanks!

Ok hopefully they’ll reply with what version they used but do you know how I could fix my networking issue from earlier?

I’m getting this error when trying to access the container using lxc console Windows10LTSC --type=vga

LXD automatically uses either spicy or remote-viewer when present.
As neither could be found, the raw SPICE socket can be found at:
  spice+unix:///root/snap/lxd/19188/.config/lxc/sockets/459275536.spice

Have you installed one of those programs to access the vga console?

I guess not, which do you recommend I install and can these be installed on Ubuntu Server?

Neither one of these will work on Ubuntu server because they are a graphical programs, cant view a windows desktop on the terminal! (unless your server has a GUI, in which case either one will do.).

You could also install the suggested viewers on windows and use it remotely but I have no experience with this.

Advertising If your open to using a web interface, which can be installed on your Ubuntu server and then accessed from your windows machine you could use my software LxdMosaic which can connect in the same way those apps would, the edge snap supports a better environment for opening large resolution windows so you could install using snap install lxdmosaic --edge or if your not using snap you can follow the link & install in a container. Playing AAA games is unlikely but click & type server software should be fine.

1 Like

I figured as much, I’m down to remote in but I cant set an IP on my Virtual Machine for some reason but all my containers have ips.

If you open the link on a Windows machine it will give you the MS Tool. You can trick it by using Chrome so you get to download the ISO directly. Here is a good example of doing that:

For anyone that didn’t know yet:

If you’re installing this on a server with no good access to display, you can get VNC access by adding the -vnc 0.0.0.0:0 option to raw.qemu like so:

  • echo -n ' -vnc 0.0.0.0:0 -drive file=/home/USER/Downloads/Win10_1909_English_x64.iso,index=0,media=cdrom,if=ide -drive file=/home/USER/Downloads/virtio-win-0.1.173.iso,index=1,media=cdrom,if=ide' | lxc config set win10 raw.qemu -

NOTE: VNC will only work after you do the part with pressing ESC and booting from the disk (and don’t forget the server firewall, VNC is TCP 5900)

Right, that still works on some distro but it’s dependent on whether VNC support is built into QEMU.

In general the recommendation is to use lxc console from a remote system which then uses the LXD API and SPICE to attach to the console. This can be done from any Linux, Windows or macOS client after adding the remote server as a remote in the client.

Take a look here, stgraber provides another way to connect to the virtual machine.

I summarized the part from this thread on launching Windows VM at the following post,

In my case,

  1. I could not access the Windows VM IP from the host or other containers. I used ping to check, and also portscanning. The Windows VM got an IP from the lxdbr0 interface as expected, though.
  2. The VM did not have soundcard support, so no audio. I suppose this is a distrobuilder issue?
  3. I tried to setup macvlan (apply macvlan profile after the Windows VM was created but was obviously stopped). The Windows VM could not start due to an error. Could start if I removed the macvlan profile.

Having said that, it was an easy and painless process to setup a Windows VM through LXD.

1 Like
  1. Windows firewall usually prevents pinging and incoming access by default.
  2. There is no virtio-snd is still in its early stages and isn’t part of LXD VMs yet. Given that there isn’t a good VGA driver either, it’s recommended that folks connect over RDP post installation, RDP allows for sound passthrough.
  3. That’s odd, what was the error?