简体   繁体   English

在 Windows 11 (Ubuntu WSL) 上安装 Anbox

[英]Install Anbox on Windows 11 (Ubuntu WSL)

I successfully installed Ubuntu WSL on Windows 11 using this guide without any issues.我使用本指南在 Windows 11 上成功安装了 Ubuntu WSL,没有任何问题。 However, when I try to install Anbox following the steps on the official website , I keep getting errors like these:但是,当我尝试按照官方网站上的步骤安装 Anbox 时,我不断收到如下错误:

error: cannot communicate with server: Post http://localhost/v2/snaps/anbox: dial unix /run/snapd.socket: connect: no such file or directory

and

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

Is there a step I need to do before I attempt to install Anbox on Ubuntu WSL?在我尝试在 Ubuntu WSL 上安装 Anbox 之前,我需要执行一个步骤吗?

PS: Please keep in mind that my technical background is extremely limited. PS:请记住,我的技术背景非常有限。 Thanks.谢谢。

You can use systemd-genie to run apps that require systemd.您可以使用systemd-genie运行需要 systemd 的应用程序。 Type:类型:

# This part adds the Microsoft repository to install dotnet-runtime, which you need for `systemd-genie`
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
# This part installs the .NET runtime
sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y aspnetcore-runtime-6.0
# This part adds the transdebian repository, which contains systemd-genie
wget -O /etc/apt/trusted.gpg.d/wsl-transdebian.gpg https://arkane-systems.github.io/wsl-transdebian/apt/wsl-transdebian.gpg

chmod a+r /etc/apt/trusted.gpg.d/wsl-transdebian.gpg

cat << EOF > /etc/apt/sources.list.d/wsl-transdebian.list
deb https://arkane-systems.github.io/wsl-transdebian/apt/ $(lsb_release -cs) main
deb-src https://arkane-systems.github.io/wsl-transdebian/apt/ $(lsb_release -cs) main
EOF
#This part installs systemd-genie
sudo apt update
sudo apt install -y systemd-genie
# This part adds a script to `~/.profile` to automatically start genie every time you start up bash.
echo "# Are we in the bottle?
if [[ ! -v INSIDE_GENIE ]]; then
  read -t 3 -p 'yn? * Preparing to enter genie bottle (in 3s); abort? ' yn
  echo

  if [[ $yn != y ]]; then
    echo 'Starting genie:'
    exec /usr/bin/genie -s
  fi
fi
" >> ~/.profile
# Restart bash
exec bash

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM