1. 修改 multipass 配置
# 设置 multipass 后端为 lxd 或者 virtualbox
sudo multipass set local.driver=lxd
2. 安装lxd
multipass networks
#报错
-------------------------------------------------------------------------
networks failed: Cannot connect to /var/snap/lxd/common/lxd/unix.socket: QLocalSocket::connectToServer: Invalid name
Please ensure the LXD snap is installed and enabled. Also make sure
the LXD interface is connected via `snap connect multipass:lxd lxd`.
---------------------------------------------------------------------------
#安装 lxd
sudo snap install lxd
multipass networks
-------------------------------------------------------------------------------
Name Type Description
enp3s0 ethernet Ethernet device
mpbr0 bridge Network bridge for Multipass
--------------------------------------------------------------------------------
# 设置桥接网卡
sudo multipass set local.bridged-network=mpbr0
# 重启,否则会报错
sudo reboot
3. 创建 vm
multipass launch -m 4G -n master --bridged
网友评论