在 Linux 上安装 VirtualBox 的过程相对简单
打开终端(Terminal)。
首先,确保系统已更新。在终端中输入以下命令并按回车键:
sudo apt update
sudo apt upgrade
添加 VirtualBox 官方仓库。根据您的 Linux 发行版,这里是一些示例命令:
wget https://download.virtualbox.org/virtualbox/debian/oracle_vbox_release_key.asc
sudo apt-key add oracle_vbox_release_key.asc
sudo add-apt-repository "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib"
wget https://download.virtualbox.org/virtualbox/fedora/oracle_vbox_release_key.asc
sudo rpm --import oracle_vbox_release_key.asc
sudo dnf config-manager --add-repo https://download.virtualbox.org/virtualbox/fedora/$(lsb_release -sc)/contrib
wget https://download.virtualbox.org/virtualbox/centos/oracle_vbox_release_key.asc
sudo rpm --import oracle_vbox_release_key.asc
sudo yum-config-manager --add-repo https://download.virtualbox.org/virtualbox/centos/$(lsb_release -sc)/contrib
更新仓库缓存:
sudo apt update (for Ubuntu/Debian)
sudo dnf update (for Fedora)
sudo yum update (for CentOS/RHEL)
sudo apt install virtualbox (for Ubuntu/Debian)
sudo dnf install virtualbox (for Fedora)
sudo yum install virtualbox (for CentOS/RHEL)
vboxmanage -v
来检查 VirtualBox 的版本。现在,您已经在 Linux 上成功安装了 VirtualBox,可以开始创建和管理虚拟机了。