sudo apt-get install openssh-server
# 下载虚拟机安装包run,并保存为virtualbox7.run
wget -O virtualbox7.run https://download.virtualbox.org/virtualbox/7.0.12/VirtualBox-7.0.12-159484-Linux_amd64.run
sh virtualbox7.run
# 格式转换,超级快,一行代码搞定
VBoxManage convertfromraw /path/to/source.img /path/to/target.vdi --format VDI
# 转换之后的vdi 要赋予最高权限 777 这样才可以确保VirtualBox 虚拟机调用
sudo chmod 777 /path/to/target.vdi
sh /opt/VirtualBox/uninstall.sh
如何用命令行安装VirtualBox 7 扩展包(识别USB设备)
wget https://download.virtualbox.org/virtualbox/7.0.12/Oracle_VM_VirtualBox_Extension_Pack-7.0.12.vbox-extpack
echo "y" | sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-7.0.12.vbox-extpack
sudo VBoxManage list extpacks
sudo groupadd usbfs
sudo adduser $USER vboxusers
sudo adduser $USER usbfs
echo "VM 扩展包安装完成,重启后才能生效。重启后USB才可以被虚拟机识别"
# 安装深度deepin缺少的依赖包udevil
wget https://mirrors-i.tuna.tsinghua.edu.cn/debian/pool/main/u/udevil/udevil_0.4.4-3_amd64.deb
sudo dpkg -i udevil_0.4.4-3_amd64.deb
# 安装深度deepin缺少的依赖包mergerfs
wget https://mirrors.sohu.com/deepin/pool/main/m/mergerfs/mergerfs_2.24.2-4_amd64.deb
sudo dpkg -i mergerfs_2.24.2-4_amd64.deb
# 备份一下原始文件
sudo cp /etc/os-release /etc/os-release.backup
修改系统名称和代号,待CasaOS安装成功后,还原回来。
sudo sed -i -e 's/^ID=.*$/ID=debian/' -e 's/^VERSION_CODENAME=.*$/VERSION_CODENAME=bookworm/' /etc/os-release
# 在深度deepin v23(debian 12) 系统下安装CasaOS
wget -qO- https://get.casaos.io | sudo bashbase
# CasaOS安装成功之后,要记得还原配置文件
sudo mv /etc/os-release.backup /etc/os-release
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://0b27f0a81a00f3560fbdc00ddd2f99e0.mirror.swr.myhuaweicloud.com",
"https://ypzju6vq.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker