温馨提示×

如何在Ubuntu中启动VirtualBox

小樊
45
2025-02-25 12:39:48
栏目: 智能运维
Ubuntu服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

在Ubuntu中启动VirtualBox的步骤如下:

  1. 安装VirtualBox
  • 打开终端,输入以下命令以更新软件包列表:
sudo apt update
  • 输入以下命令以安装VirtualBox:
sudo apt install virtualbox
  1. 启动VirtualBox
  • 安装完成后,可以在应用程序菜单中找到VirtualBox并打开它。
  1. 通过命令行启动VirtualBox
  • 打开终端,输入以下命令启动VirtualBox:
virtualbox
  1. 设置VirtualBox开机自动启动(可选):
  • /etc/default/ 目录下新建 virtualbox 文件,并添加以下内容:
# VBOXAUTOSTART_DB=/etc/vbox
# VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.conf
  • 设置 vbox 目录的权限,将当前用户添加到 vboxusers 用户组:
sudo chgrp vboxusers /etc/vbox
sudo chmod 1775 /etc/vbox
sudo usermod -aG vboxusers $USER
  • 新建虚拟机自动启动配置文件 autostart.conf 并添加以下内容:
# Default policy is to deny starting a VM, the other option is "allow".
# default_policy  deny
# user vbox is allowed to start virtual machines but starting them
# will be delayed for 10 seconds

# Example: Allow user vbox to start a VM named "XP" with a startup delay of 10 seconds.

# Example: Allow user vbox to start a VM named "XP" without a startup delay.

# Example: Deny starting any VMs.

# Example: Allow user vbox to start a VM named "XP" with a startup delay of 10 seconds.
allow
startup_delay 10

# Example: Allow user vbox to start a VM named "XP" without a startup delay.
# allow
# startup_delay 0
  • 设置开启自动启动:
VBoxManage setproperty autostartdbpath /etc/vbox
VBoxManage modifyvm win2003 --autostart-enabled on

完成以上步骤后,您就可以在Ubuntu中启动并使用VirtualBox了。如果遇到任何问题,可以参考VirtualBox的官方文档或搜索相关教程。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:如何在Ubuntu中运行VirtualBox

0