Original link: [Xinchuang] virtual machine in virtualbox connected to U disk | UnionTech | Kirin | Zhongke Fangde
Hello, everyone! Today I bring you an article about using VirtualBox virtual machine to connect to a physical host USB flash drive on the Xinchuang operating system. When using a VirtualBox virtual machine, it is sometimes necessary to connect a USB flash drive on the physical host to the virtual machine for data transfer or operation. In this article, we'll take a closer look at how to do this. Welcome everyone to share and forward, click to follow and watch!
precondition
Before you begin, make sure you've done the following:
安装了VirtualBox和VirtualBox Extension Pack。
There is a running VirtualBox virtual machine on the Xinchuang operating system.
步骤1:安装VirtualBox Extension Pack
The VirtualBox Extension Pack provides support for USB 2.0 and 3.0 devices. If you haven't already, follow the steps below to install it.
下载Extension Pack:
Download the Extension Pack from the official VirtualBox website that matches your current version.
安装Extension Pack:
Use the command to select the downloaded Extension Pack to install it.
Step 2: Configure user permissions
Make sure that the current user belongs to the vboxusers group in order to access the USB device.
To add a user to the vboxusers group:
sudo usermod -aG vboxusers $USER
Log back in:
Once you've done this, you'll need to log out and log back in for the changes to take effect.
Step 3: Configure the virtual machine USB settings
Open the virtual machine settings:
In the VirtualBox Manager, select the target virtual machine and click Settings.
Configure the USB controller:
In the settings window, select the "USB" tab, enable the USB controller, and select the USB 2.0 or USB 3.0 controller according to your USB flash drive.
Add USB Device Filter:
In the same window, click on the USB plug icon on the right to add the device filter for the USB flash drive. This will ensure that the USB flash drive is automatically connected when the virtual machine boots.
Step 4: Start the virtual machine and connect the USB flash drive
Start the virtual machine:
Start the target virtual machine in VirtualBox Manager.
Connect to a USB flash drive:
Once the virtual machine is booted up and the operating system is entered, click on the USB icon at the bottom of the VirtualBox window and select the USB flash drive you want to connect to. If the device filter has been configured, the USB flash drive should connect automatically.
1. Check the system version
pdsyw@pdsyw1024:~/桌面$ cat /etc/os-release
pdsyw@pdsyw1024:~/桌面$ uname -a
2. Install the virtual machine
3. Click About
4. Check the software version number
5. Download the corresponding expansion pack
https://download.virtualbox.org/virtualbox/<version>/Oracle_VM_VirtualBox_Extension_Pack-<version>.vbox-extpack
https://download.virtualbox.org/virtualbox/6.1.38/Oracle_VM_VirtualBox_Extension_Pack-6.1.38.vbox-extpack
6. Install the expansion package
pdsyw@pdsyw1024:~/桌面$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.38.vbox-extpack
7. Check if the software version and the extension package version match
pdsyw@pdsyw1024:~/桌面$ VBoxManage -v
6.1.38_Ubuntur153438
pdsyw@pdsyw1024: ~/Desktop$
pdsyw@pdsyw1024:~/桌面$ VBoxManage list extpacks
Extension Packs: 2
Pack no. 0: Oracle VM VirtualBox Extension Pack
Version: 6.1.38
Revision: 153438
Edition:
Description: Oracle Cloud Infrastructure integration, USB 2.0 and USB 3.0 Host Controller, Host Webcam, VirtualBox RDP, PXE ROM, Disk Encryption, NVMe.
VRDE Module: VBoxVRDP
Usable: true
Why unusable:
Pack no. 1: VNC
Version: 6.1.38
Revision: 153438
Edition:
Description: VNC plugin module
VRDE Module: VBoxVNC
Usable: true
Why unusable:
pdsyw@pdsyw1024: ~/Desktop$
8. The version does not match the uninstall method
pdsyw@pdsyw1024:~/桌面$ sudo VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
9. Add users to the vbox group
pdsyw@pdsyw1024:~/桌面$ sudo usermod -aG vboxusers pdsyw
10. Log out and log back in
11. Create a new virtual machine
12. Enter a name
13. Allocate memory
14. Create a hard drive
15. Select the file type
16. Dynamic Allocation
17. Select the size of the hard drive
18. Click Settings
19. Select Virtual Disk
20. Add complete
21. Select the USB controller
22. Initiate the installation
23. To install, please review the previous article
https://mp.weixin.qq.com/s/D80pCu0HQkPDziHuNa8lvw
24. Assign a USB device to the virtual machine
25. Virtual machine recognition is normal
Common Problem Solving
The virtual machine does not recognize the USB flash drive:
确保VirtualBox Extension Pack已正确安装。
Check if the current user has joined the vboxusers group and is logged back in.
USB flash drive cannot be automatically mounted:
Ensure that the USB controller and device filters are properly configured in the virtual machine USB settings.
Try to manually mount a USB flash drive.
Device Conflicts:
Make sure that the USB flash drive is not occupied on the physical host (for example, uninstall the USB flash drive from the host system).
Through the introduction of this article, you should have mastered how to use VirtualBox virtual machine to connect to a physical host USB flash drive on Xinchuang operating system. By properly installing and configuring the VirtualBox Extension Pack, setting up the USB controller and device filters, you can easily access the USB flash drive from the virtual machine. If you find this article useful, please share and retweet. At the same time, don't forget to follow and watch, so that you can get more practical technical information and solutions in the future. Thank you all for reading and we'll see you next time!