mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-28 01:01:09 +08:00
translated
This commit is contained in:
parent
4d2348501b
commit
110123910c
@ -1,116 +0,0 @@
|
||||
[#]: subject: "Access USB from Virtual Machine in VirtualBox on Linux"
|
||||
[#]: via: "https://itsfoss.com/virtualbox-access-usb/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Access USB from Virtual Machine in VirtualBox on Linux
|
||||
======
|
||||
|
||||
When you plug in a USB, your host OS can easily access it and use the files on it. That's not a surprise.
|
||||
|
||||
If you are using virtual machines with Virtual Box on Linux, you can put some effort and access the USB plugged in to your physical machine from the VM.
|
||||
|
||||
Let me walk you through step-by-step how you can access a USB disk in VirtualBox VM.
|
||||
|
||||
### How to access a USB drive in VirtualBox VM
|
||||
|
||||
By default, you can not use VirtualBox to access the USB drive as you have to install the extension pack manager and additionally, a little configuration part is also there.
|
||||
|
||||
This is the reason why I've divided this tutorial into three easy steps. So let's start with the first one.
|
||||
|
||||
#### Step 1: Install the VirtualBox extension pack (on host)
|
||||
|
||||
This is the most important step of this tutorial as you are about to install an extension of VirtualBox which will enable you to use a USB drive in a VM.
|
||||
|
||||
🚧
|
||||
|
||||
You should install the same version extension pack as your installed version of VirtualBox.
|
||||
|
||||
To install the VirtualBox extension pack, simply visit the [official download page of VirtualBox][1], scroll down a bit and there you will find an option to download the extension pack:
|
||||
|
||||
![][2]
|
||||
|
||||
Once you are done downloading the extension pack follow 3 simple steps:
|
||||
|
||||
* Go to `File` > `Tools` > `Extension Pack Manager`
|
||||
* Hit the `Install` button
|
||||
* Select the downloaded file from the file manager:
|
||||
|
||||
|
||||
|
||||
![Click to expand][3]
|
||||
|
||||
It will open a new prompt to install the extension pack where all you have to do is hit the Install button and accept the terms and conditions:
|
||||
|
||||
![Click to expand][4]
|
||||
|
||||
And we are done with the installation of the extension pack.
|
||||
|
||||
#### Step 2: Add the user to the vboxusers group (on host)
|
||||
|
||||
To use a USB drive in VirtualBox, your current user needs to be in the `vboxusers` group.
|
||||
|
||||
I know it sounds a little complex but [adding a user to the group][5] is one command process and to add your user to `vboxusers group can be done by following:
|
||||
|
||||
```
|
||||
|
||||
sudo usermod -aG vboxusers $USER
|
||||
|
||||
```
|
||||
|
||||
**Once you are done with these two steps, reboot your system to take effect from the steps.**
|
||||
|
||||
#### **Step 3: Add USB drive to VM**
|
||||
|
||||
🚧
|
||||
|
||||
Before you add a USB for a specific VM, make sure it is powered off (not saved) or you won't be able to follow the given instructions.
|
||||
|
||||
To add USB for VM, you have to follow the given simple steps:
|
||||
|
||||
* Select the VM on which you want to use USB and hit `Settings`
|
||||
* Go to `USB` tab
|
||||
* Check the `Enable USB Controller` box and select the USB by clicking on `+` button:
|
||||
|
||||
|
||||
|
||||
![][6]
|
||||
|
||||
And that's it! Now you can start your VM and the USB drive should reflect in the file manager. In my case it was Ubuntu, so it looked like this:
|
||||
|
||||
![][7]
|
||||
|
||||
### More USB and VM trick
|
||||
|
||||
If using USB in a VM looks cool to you, booting from it in the VM is even cooler! And here's a detailed guide on [how to boot from a USB drive in VirtualBox][8]:
|
||||
|
||||
![][9]
|
||||
|
||||
I hope you will find this guide helpful.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/virtualbox-access-usb/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.virtualbox.org/wiki/Downloads
|
||||
[2]: https://itsfoss.com/content/images/2023/09/download-VirtualBox-extension-pack.png
|
||||
[3]: https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack-to-use-USB-in-VM.png
|
||||
[4]: https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack.png
|
||||
[5]: https://learnubuntu.com/add-user-group/
|
||||
[6]: https://itsfoss.com/content/images/2023/09/Enable-USB-drive-for-VM-in-VirtualBox.png
|
||||
[7]: https://itsfoss.com/content/images/2023/09/Use-USB-drive-in-VirtualBox-VM-1.png
|
||||
[8]: https://itsfoss.com/virtualbox-boot-from-usb/
|
||||
[9]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
@ -0,0 +1,116 @@
|
||||
[#]: subject: "Access USB from Virtual Machine in VirtualBox on Linux"
|
||||
[#]: via: "https://itsfoss.com/virtualbox-access-usb/"
|
||||
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
|
||||
[#]: collector: "lujun9972/lctt-scripts-1693450080"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
在 Linux 上的 VirtualBox 中从虚拟机访问 USB
|
||||
======
|
||||
|
||||
当你插入 USB 时,你的宿主操作系统可以轻松访问它并使用其中的文件。这并不奇怪。
|
||||
|
||||
如果你在 Linux 上使用带有 Virtual Box 的虚拟机,那么可以付出一些努力并从虚拟机访问插入物理机的 USB。
|
||||
|
||||
让我逐步引导你了解如何在 VirtualBox VM 中访问 USB 磁盘。
|
||||
|
||||
### 如何在 VirtualBox VM 中访问 USB 驱动器
|
||||
|
||||
默认情况下,你无法使用 VirtualBox 访问 USB 驱动器,因为你必须安装扩展包管理器,此外,还有一些配置部分。
|
||||
|
||||
这就是我将本教程分为三个简单步骤的原因。那么让我们从第一步开始。
|
||||
|
||||
#### 步骤 1:安装 VirtualBox 扩展包(在主机上)
|
||||
|
||||
这是本教程中最重要的一步,因为你将安装 VirtualBox 的扩展,这将使你能够在虚拟机中使用 USB 驱动器。
|
||||
|
||||
🚧
|
||||
|
||||
你应该安装与你安装的 VirtualBox 版本相同版本的扩展包。
|
||||
|
||||
要安装 VirtualBox 扩展包,只需访问 [VirtualBox 官方下载页面][1],向下滚动一点,你将找到下载扩展包的选项:
|
||||
|
||||
![][2]
|
||||
|
||||
下载完扩展包后,请执行 3 个简单步骤:
|
||||
|
||||
* 转到`文件` > `工具` > `扩展包管理器`
|
||||
* 点击`安装`按钮
|
||||
* 从文件管理器中选择下载的文件:
|
||||
|
||||
|
||||
|
||||
![Click to expand][3]
|
||||
|
||||
它将打开一个新的提示来安装扩展包,你所要做的就是点击“安装”按钮并接受条款和条件:
|
||||
|
||||
![Click to expand][4]
|
||||
|
||||
我们就完成了扩展包的安装。
|
||||
|
||||
#### 步骤 2:将用户添加到 vboxusers 组(在宿主机上)
|
||||
|
||||
要在 VirtualBox 中使用 USB 驱动器,你的当前用户需要位于 `vboxusers` 组中。
|
||||
|
||||
我知道这听起来有点复杂,但[将用户添加到组][5]是一个命令过程,将用户添加到 vboxusers 组可以通过以下方式完成:
|
||||
|
||||
````
|
||||
|
||||
sudo usermod -aG vboxusers $USER
|
||||
|
||||
````
|
||||
|
||||
**完成这两个步骤后,重启系统以使这些步骤生效。**
|
||||
|
||||
#### **步骤 3:将 USB 驱动器添加到虚拟机**
|
||||
|
||||
🚧
|
||||
|
||||
在为特定虚拟机添加 USB 之前,请确保其已关闭(未保存),否则你将无法按照给定的说明进行操作。
|
||||
|
||||
要为虚拟机添加 USB,你必须遵循以下简单步骤:
|
||||
|
||||
* 选择你想要使用 USB 的虚拟机并点击`设置`
|
||||
* 转到 `USB` 选项卡
|
||||
* 选中`启用 USB 控制器`框并单击 `+` 按钮选择 USB:
|
||||
|
||||
|
||||
|
||||
![][6]
|
||||
|
||||
这就好了!现在你可以启动虚拟机,并且 USB 驱动器应该出现在文件管理器中。就我而言,它是 Ubuntu,所以它看起来像这样:
|
||||
|
||||
![][7]
|
||||
|
||||
### 更多 USB 和 VM 技巧
|
||||
|
||||
如果你在虚拟机中使用 USB 看起来很酷,那么在虚拟机中从 USB 启动就更酷了!这里有一个关于[如何在 VirtualBox 中从 USB 驱动器启动][8]的详细指南:
|
||||
|
||||
![][9]
|
||||
|
||||
我希望本指南对你有所帮助。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/virtualbox-access-usb/
|
||||
|
||||
作者:[Sagar Sharma][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/sagar/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.virtualbox.org/wiki/Downloads
|
||||
[2]: https://itsfoss.com/content/images/2023/09/download-VirtualBox-extension-pack.png
|
||||
[3]: https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack-to-use-USB-in-VM.png
|
||||
[4]: https://itsfoss.com/content/images/2023/09/Install-VirtualBox-extension-pack.png
|
||||
[5]: https://learnubuntu.com/add-user-group/
|
||||
[6]: https://itsfoss.com/content/images/2023/09/Enable-USB-drive-for-VM-in-VirtualBox.png
|
||||
[7]: https://itsfoss.com/content/images/2023/09/Use-USB-drive-in-VirtualBox-VM-1.png
|
||||
[8]: https://itsfoss.com/virtualbox-boot-from-usb/
|
||||
[9]: https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png
|
Loading…
Reference in New Issue
Block a user