我用snap商店在ubuntu中安装了LXD,然后将它连接到windows客户端,但要想从Windows运行容器,Ubuntu应用程序必须是打开的。是否有一种在后台运行LXD服务器的方法,或者需要打开Ubuntu才能工作?wsl --status返回:
Default Distribution: Ubuntu
Default Version: 2wsl --version返回:
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.1098cmd /c ver返回:
Microsoft Windows [Version 10.0.22000.1098]发布于 2023-01-29 04:36:02
在windows启动时运行此vbs脚本。只需将其放入windows启动文件夹(crl+r -> shell:startup)即可。
wsl-startup.vbs:
# change '<Distro>' to the distro name you are using.
set ws=wscript.CreateObject("wscript.shell")
ws.run "wsl -d <Distro>", 0表格:https://github.com/microsoft/WSL/issues/8854#issuecomment-1421910739
之后,每次你启动你的机器并登录。它将启动wsl并等待输入。wsl实例将保持活动状态。
然后,您可以使用systemd在后台运行您想要的任何内容。
如果使用wsl -t <distro> / wsl --shutdown手动重新启动wsl实例,则应重新运行vbs。
https://askubuntu.com/questions/1435938
复制相似问题