1.前期准备
VirtualBox 官网安装
VM使用的ubuntu系统的.ova文件。
2.安装VBoxGuestAdditions.iso
在安装时增强功能时,

出现了如下问题,


此时可以通过Ctrl+Alt+T打开终端,sudo su 进入root 权限,ls /media/student (Ubuntu用户名是student)可以看到有一个VBox_GAs_6.0.8 文件夹,
cd /VBox_GAs_6.0.8 进入该文件夹,可以看到

然后在终端上执行 sudo sh ./VBoxLinuxAdditions.run。
最后reboot,重启后就可以进行虚拟机与主机的复制粘贴了。
3.设置共享文件夹
在虚拟机的设备中进行文件夹设置(修正下,在自动挂载处要打勾)


最后可以看到刚刚设置的文件夹VM_S

然后设置使用权限,执行命令将用户加入vboxsf组,在终端中sudo adduser student vboxsf(Ubuntu用户名是student)。
最后 reboot。重启后就可以进行虚拟机与主机的共享文件夹了。

4.如何在Virtualbox中对Ubuntu系统根分区扩容
5.Virtualbox中调用电脑摄像头
VirtualBox 需要安装 Oracle VM VirtualBox Extension Pack 才能使用摄像头。
进入 VirtualBox 官网下载页面:https://www.virtualbox.org/wiki/Downloads
选择与 VirtualBox 版本一致的,6.x.x,测试6.0.10可以。
在 管理 -> 全局设定 -> 扩展 -> 新增下载好的 Oracle VM VirtualBox Extension Pack 并安装。

安装完成后,启动虚拟机。
在 设备 -> 摄像头 -> 启用摄像头设备(名字各有不同)
启用后,可以通过命令:
ls /dev/video*
查看是否存在 camera 设备,如果有,则会显示出来,之后可以用cheese
测试摄像头
# 安装 cheese
sudo apt-get install -y cheese
# 调用 cheese
cheese
# 调用指定的摄像头
cheese -d /dev/video1
网友评论