VirtualBox 命令行下添加U盘到虚拟机

本次添加U盘的虚拟机名称是Win7服务器

启用USB
VBoxManage modifyvm Win7 --usb on
VBoxManage modifyvm Win7 --usbehci on
VBoxManage modifyvm Win7 --usbxhci on
添加一个USB过滤,也就是加了一个设备  【由于以前没添加过,因此add 后面是 0,不清楚这个,请本身查一下VBoxManage的帮助】帮助地址https://my.oschina.net/lwkai/blog/3016205
VBoxManage usbfilter add 0 -target Win7 --name Print --action hold -product "HP LaserJet MFP M427fdn" 
查看宿主机有哪些设备
VBoxManage list usbhost
服务器显示以下(只贴了部份内容)
UUID:               dd6821fd-219b-431f-9e8d-2e861c211b5b
VendorId:           0x03f0 (03F0)
ProductId:          0x5a2a (5A2A)
Revision:           1.0 (0100)
Port:               0
USB version/speed:  2/High
Manufacturer:       Hewlett-Packard
Product:            HP LaserJet MFP M427fdn
SerialNumber:       CNB8J3J56C
Address:            sysfs:/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1//device:/dev/vboxusb/001/006
Current State:      Captured微信

修改USB过滤器的方法
#VBoxManage usbfilter modify 0 --target Win7 --remote noui

移除设备
VBoxManage usbfilter remove 0 --target Win7.net

5. Making USB Work in VirtualBox
VirtualBox requires the user have write access to "usbfs" devices for USB access. As root perform the following:
mkdir /vbusbfs
echo "none /vbusbfs usbfs rw,devgid=$(awk -F : '/vboxusers/ {print $3}' /etc/group),devmode=664 0 0" >> /etc/fstab
mount -aorm

第五点,好像是要弄。反正最后我重启机器,就看到设备了。blog

 

本人微信:   本人QQ:ci

相关文章
相关标签/搜索