1. When the VirtualBox and expansion packs are installed, the system will automatically generate Vboxusers user groups, add their own usernames to the Bvoxusers group, or you will not be able to use VBox.
sudo usermod-g vboxusers your_user_name
2. Using a USB device:
Turn on the USB device option in the VirtualBox virtual machine configuration panel and tick the "Start USB controller" "Enable USB2.0 Controller" option separately.
1, the simplest method is as follows:
$ sudo gedit/etc/fstab
At the end, add
# The USB group
# Open and write access to USB devices for all users
None/proc/bus/usb Usbfs devmode=666 0 0
The USB device can then be used by LIBUSB for normal users.
2. However, the way to open the read and write permissions of USB devices to all users is less secure in some cases, and it is more prudent to:
1. Add User group name
$ sudo groupadd name
2. View GID for the USBFS user group
$ Cat/etc/group | grep name
NAME:X:1002:
3. Add the current user to the USBFS group
$ sudo gedit/etc/group
Put
NAME:X:1002:
Revision changed to
Name:x:1002:name2
4. To reset the permissions for the USB device edit the/etc/fstab file, add the following two lines, note that your GID may not be 1002
$ sudo gedit/etc/fstab
At the end, add
# 1002 is the USB group ID
None/proc/bus/usb Usbfs devgid=1002,devmode=664 0 0
5. After restarting, you should be able to use the USB device in the client computer.
Note: You should uninstall the USB device in the host computer before using it.
Cat/etc/group grep vboxusers
Vboxusers:x:123:name #此时可以查看到name以及被加到此用户组了
sudo gedit/etc/fstab #编辑fstab文件
In the last line, add the following command to save
None/proc/bus/usb Usbfs devgid=1001,devmode=664 0 0
#none/proc/bus/usb Usbfs devgid=1
Linux virtual machine VirtualBox USB Device Settings