10

I installed LXD in ubuntu with the snap store and then conncted it to the windows client, but for me to be able to run containers from Windows the Ubuntu app has to be open. Is there a way to have the LXD server run in the background or will I have to have Ubuntu open for it to work? wsl --status returns:

Default Distribution: Ubuntu
Default Version: 2

wsl --version returns:

WSL version: 0.70.0.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.1098

and cmd /c ver returns:

Microsoft Windows [Version 10.0.22000.1098]
Luxvoo
  • 301
  • Although is looks and behaves like an "app", it's actually a full-fledged albeit minimal OS running in a way not dissimilar to a virtual machine. Knowing that the answer to your question should be obvious. – ChanganAuto Oct 17 '22 at 19:49
  • Well yes, but I can’t seem to find how to. It clearly isn’t working if the app is closed? – Luxvoo Oct 17 '22 at 20:05
  • Well, that's because the obvious answer is the opposite of what you think it is. And again, Ubuntu is NOT an app. – ChanganAuto Oct 17 '22 at 20:08
  • What about when I use Rancher desktop? It uses WSL to run containers and I know that I don’t have to have the custom distro open. It also seems that a VM should be able to run in the background (without any GUI/cli). There is a high chance that I don’t understand how VMs work, but I have no idea why VMs couldn’t run in the background. Again I’m new to this and I’m not qualified to say anyhing. Thanks for the help I guess. – Luxvoo Oct 17 '22 at 20:22
  • Rancher Desktop is (quoting) an open-source desktop application* for Mac, Windows and Linux. Rancher Desktop runs Kubernetes and container management on your desktop.* – ChanganAuto Oct 17 '22 at 20:25
  • You're confusing software that runs in an OS (Ubuntu in this case, could be any other Linux distro) with the OS itself and the layer that allows the OS to run inside another OS (WSL). – ChanganAuto Oct 17 '22 at 20:27
  • 2
    Well I need the LXD server to be avaliable when the cli for Ubuntu is closed. Not when WSL is completely shut down. I see absolutely no reason why closing the cli would shut down Ubuntu thus I don’t see why the server is not avaliable. The only thing you’ve told me is that it doesn’t work. But I would greatly appreciate it If you explain why this could never work. – Luxvoo Oct 17 '22 at 20:37
  • 2
    LXD runs under Ubuntu therefore you need Ubuntu running, end of story. – ChanganAuto Oct 17 '22 at 20:38
  • The fact that I still have a question will bother you, but didn’t Microsoft add deamon support after the last bash.exe process has been killed? Shouldn’t the lxd deamon continue running in the background even if the bash process has been killed, please note that Ubuntu shouldn’t close if you have a deamon running in the background, at least thats what I understood from an arcticle I found? – Luxvoo Oct 17 '22 at 21:24
  • 1
  • bash.exe has nothing to do with Ubuntu (the .exe should be clue enough); 2. Please understand this quite obvious situation: when the cli for Ubuntu is closed, Ubuntu is closed (granted, maybe not obvious for you because you're very confused). Then 3. anything you install in Ubuntu needs Ubuntu running, the same way any software installed in the guest OS (VM) CANNOT run by itself in the host OS. There's absolutely nothing else to understand here.
  • – ChanganAuto Oct 17 '22 at 22:10
  • @Luxvoo Welcome to Ask Ubuntu! Can you provide your WSL and Windows version? The answer to your question probably depends a bit on this. wsl --status, wsl --version, and cmd.exe /c ver? Would you add that info to your question? Note that wsl --version may not work, depending on the actual version. Thanks! – NotTheDr01ds Oct 18 '22 at 01:19
  • 1
    @NotTheDr01ds I added the versions. All of them ran. (I am on the preview version of WSL) – Luxvoo Oct 18 '22 at 05:05
  • @ChanganAuto The bash.exe does have to do a lot with ubuntu, It's the cli I think. But the point is when you close the cli (the last bash.exe proccess) it SHOULDN'T close as far as I'm concerned. – Luxvoo Oct 18 '22 at 05:10
  • 1
    @ChanganAuto You know I answer a lot of Ubuntu-on-WSL questions, and trust me, this is a pretty good question. Also bash.exe is the legacy (now deprecated) way of launching Ubuntu on WSL. It was a horrible name, clearly, but that's why it was changed to wsl.exe. – NotTheDr01ds Oct 18 '22 at 11:49
  • @NotTheDr01ds Okay thank you so much! Don’t rush it I have time. Again thanks for looking into it. – Luxvoo Oct 18 '22 at 12:11
  • @NotTheDr01ds I know how it feels, as I am a type of person who forgets to save their work and then loses everything lmao. – Luxvoo Oct 18 '22 at 15:41