LXD on Windows 10 WSL?


#1

Has anyone tried to run LXD on the Windows 10 Windows Subsystem for Linux (WSL) bash?

LXD comes with the latest Ubuntu version (18.04) that windows loads up, but I cannot get the
LXD daemon to run. It is failing to start. I tried the following:

$ sudo systemctl enable lxd.service

…and get this:
Starting Container hypervisor based on LXC: lxd.
Error: LXD still not running after 600s timeout (Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory)

And sure enough, it’s not lying…no unix.socket file to be found anywhere!

So is the Win 10 WSL too crippled to work? You would think if they include the LXD/LXC software in their bionic build, it should work…right?

I would really like to see this work as I am working on a container based feature that would be great
on a Windows box.

I did post this to the Microsoft/WSL github issues…

Thanks,

Ray


#2

for anyone interested, the reply was pretty clear: WSL is NOT some sort of new VM implementation, it’s a way to run Linux apps on Windows; no systemd = no LXD on Ubuntu WSL. That’s it. It’s not even clear if WSL supports cgroups. If not, it will not work on any distribution.


#3

Windows support HyperV for virtual machines.
You can either run Ubuntu in HyperV and then install LXD, or follow this guide,


and install multipass to get Ubuntu and then install LXD.


#4

I certainly know what VM is.And I know what WSL is. I have been using vBox for years. But the thought of running LXD on a windows 10 WSL without installing other software is intriguing.

Why would MS include LXD in their bionic bash WSL if it don’t work?

And is MS considering implementing systemd?

Thanks for your response.

Ray


#5

I am using Windows 10 Home. I think Hyper-V is in the Windows 10 Pro version?

Ray


#6

see comment
if you are using Windows home, Multipass is out as well.
Your best bet is probably Virtual Box (or Vmware if they are still providing sutff for Windows)


#7

LXD appears in the repositories (and probably in the container image for WSL) because it is the stock Ubuntu container image. It can get confusing if it appears there while it cannot work without a Linux kernel.

It would be possible for LXD to run natively on WSL if WSL provided all the necessary features that LXD requires from the Linux kernel.


#8

Bummer. Personally I think it could be a game changer if LXD could run efficiently in WSL.

Thanks again.

Ray


#9

That would be defeating my purpose. If I installed HyperV, I’d stick with running VM’s and not LXD.


#10

But you have a limited number of VMs that your server can run. If you are content with very few VMs and have a high end server, then you are ok with a VM.


#11

I just upgraded to Win 10 Pro…if that makes any difference?


#12

yes as said before, Windows Home can’t handle Multipass, so that’s an option now available , lucky you :slight_smile: . Now I don’t know much Multipass and I can’t help you with it, but other can certainly do it.


#13

So…with Multipass, can I run multiple instances of Ubuntu at the same time?


#14

With multipass you can create multiple Ubuntu VMs. In each of them you can install LXD.
Normally you would start with a single VM and a nice LXD installation.

Multipass in not a requirement; you can use any other VM tool as well. It is lightweight though, and it is the same tool on native Ubuntu.


#15

So trying it out and running into this problem:

C:\Users\rayj0>multipass launch
launch failed: timed out waiting for instance to respond

C:\Users\rayj0>multipass list
Name State IPv4 Release
preferred-curassow STOPPED – Ubuntu 18.04 LTS
relieved-kudu STOPPED – Ubuntu 18.04 LTS

C:\Users\rayj0>multipass start preferred-curassow
start failed: timed out waiting for instance to respond

I read about possible firewall issues so I turn off Norton 360 firewall but no help.

Any ideas?


#16

Have a look at https://discourse.ubuntu.com/t/installing-multipass-for-windows/9547
The requirements are:

  1. Only Windows 10 Pro or Enterprise , build 1803 or later is currently supported.
  2. Make sure the network you’re connected to is marked Private (which really means Trusted ), otherwise Windows will prevent Multipass from starting. We’re working on resolving that issue.
  3. You will need to allow the installer to gain Administrator privileges.

(lhprojects) #17

I’m a bit confused, on the Github page, it states creation, management and maintenance of virtual machines. This seems far from containers ? Notwithstanding, the Github repository is vague about the underlying technology?


#18

multipass is a tool to create virtual machines (VM), based on KVM (Linux), HyperV (Windows) and also for MacOS (not sure which).
I got you covered with https://blog.simos.info/multipass-management-of-virtual-machines-running-ubuntu/

On Windows you cannot run LXD directly, so you need first a VM running Ubuntu or other Linux, then setup LXD in there.
So, you can either use HyperV with an Ubuntu image, multipass over HyperV, VMWare, Virtualbox or something else.

If HyperV is too much trouble (i.e. requires a version of Windows you do not have), then go for an alternative.


#19

I installed multipass on Windows 10 Pro. Is there anything else I need to do besides the Multipass?

Ray


#20

These are the requirements,

After installation, try to create an Ubuntu VM.
Allocate enough memory and disk space so that LXD can work well.