Virtual Usb Drive Mac

One of the best and classic features of the iPod is the ability to use it as a virtual drive, plugging them in any PC/Mac and transfer files to/from the device. IPhone/iPad/iPod Touch do not have this feature built-in, but a few alternative solutions should let you use your iOS device as a virtual USB/external hard drive. In addition to the standard single file disk images that you can create with Disk Utility on macOS, there are two other very useful options. A sparse disk image only takes up the space required for the data that you put into it. Download Remote Drive for Mac - Pro and enjoy it on your iPhone, iPad, and iPod touch. ‎Turn your iPhone or iPad into the wireless flash drive for your Mac. Have full access to your Mac files – use your iOS device to stream videos, view photos and documents, from anywhere within your home. How to create the USB installer. Insert your UFD into your Mac and launch Terminal. Enter the following command to identify the mounting point assigned to your USB drive: diskutil list. If you want to create a virtual USB device, you will also have to create a virtual USB controller (IOUSBController / IOUSBControllerV2 / IOUSBControllerV3 subclass) to which the virtual USB device would be attached. The controller itself would match on IOResources and would have to emulate the functionality of a real USB controller.

Sometimes you just need to access a USB drive from a VirtualBox VM! We take a look at how to make this happen in this post.

Join the DZone community and get the full member experience.

Join For Free

This is part three of a three-part series on VirtualBox. Parts one and two demonstrate how to install VirtualBox on a Debian host, and to build a FreeBSD virtual machine. This post shows you how to access, from your guest OS, a flash drive mounted on the Debian host.

Prerequisites

The VirtualBox extension pack must be installed on the VirtualBox host. See part 2 for instructions.

Configuring USB

Follow the steps below to configure the VirtualBox USB.

Virtual Usb Drive Mac

  1. Add the user to the vboxusers group. VirtualBox access to the host's USB drives is only granted to users of the vboxusers group. As root on the host, run the following command to add each VirtualBox user (e.g., peter) to the group.

  2. Power off VM. VirtualBox defaults to using USB Controller 1.1 (OHCI). Modern hardware uses USB Controller 2.0 (EHCI) and USB Controller 3.0 (xHCI). Before you can change the USB controller protocol, the virtual machine must be powered off.

  3. Open VirtualBox Manager, click Settings, and select USB.

  4. Specify USB Controller.

    Select either USB 2.0 (EHCI) Controlleror USB 3.0 (xHCI) Controller according to your actual hardware.

    Note that you can add USB Device Filters to define the types of USB drives which will be automatically made visible to the guest OS. Be forewarned that the USB drive, once made visible to the guest OS, will no longer be available to the host. More on the use of device filters in the next section.

Accessing the USB Drive

Below is the step-by-step procedure to mount and access a flash drive.

  1. Insert the flash drive into your host machine's USB port.

  2. Unmount the flash drive (if it is auto-mounted on your host).
    Making it available to the guest will automatically and instantly unmount it from the host. To avoid any data loss due to pending writes to the drive, it is a good practice to explicitly unmount the drive prior to handing control to the guest.

  3. Power on the FreeBSD guest.

  4. Assign the USB drive to the guest OS.


    Open the virtual system console, and right click the USB driveicon.


    Click to select your USB drive.

    Note, this is a one-time assignment only. Please see instructions at the end of the section on how to automatically assign this particular USB drive for all subsequent sessions.
  5. Login to FreeBSD, and mount the drive. You can mount an MS-DOS-based flash drive by running the following commands as root. Replace /dev/da0s1 with the proper device identifier for your USB drive (you can find out the exact device ID by first running dmesg to identify the device name, e.g. da0, and fdisk to reveal the disk partition structure, e.g., s1).

    To unmount the drive,

To always automatically assign a particular USB drive to the guest OS, open the VirtualBox Manager, click Settings, and then USB.

Usb drive mac formatVirtual Usb Drive Mac

Finally, click the Add USB device filter (with the + sign) icon, and select the USB drive that is currently inserted into the host.

virtualbox,vm,virtual machine,integration

Published at DZone with permission of Peter Leung, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

How to use USB in VirtualBox2

Sometimes the user urgently needs to connect the USB flash-drive or hard disk to the virtual machine. Despite all the manual efforts, he is just not capable to do it on his own, and in this case my instruction will be especially helpful. In this note I will in detail explain, how to connect USB-device to VirtualBox. Also I will mention, how to boot from USB drive in VirtualBox, and how to do it easily and simply.

One of the main preconditions for performing this manual is prior setting up of Oracle VM VirtualBox app, VirtualBox Guest Additions package and VirtualBox Extension Pack onto your PC. I will not clarify how to install most of this software, except Extension Pack. Just make sure, that all of the defined plugins are configured and customized before continuing the basic procedure.

How to install VirtualBox Extension Pack on the VM?

Extension pack is a set of utilities designed to enhance the interaction between the user and the virtual machine. The procedure of installing the package is absolutely elementary and intuitive. One primary condition – the package should be installed in VirtualBox, i.e. when the VM is running. At first we need to surf the web in search of the extension package, visit the official VirtualBox FTP-server and download the corresponding installation distributive from there. The link goes right here: http://download.virtualbox.org/virtualbox. Check out the active version of your current VirtualBox installation. In order to bring this intention to life, click Help -> About VirtualBox item in the upper menu.

Virtual machine usb drive

In the bottom part of the displayed window the build number will display. Following this information, you will have to download the appropriate package from the FTP-server.

Now, when the file is downloaded, choose the active VM instance, click File -> Preferences in the upper menu and go to “Extensions” subcategory.

After that click on the button with an arrow on the right and specify a path to the just downloaded from FTP-server package.

At last, the dialogue form appears with prompt of extension pack installing. Agree on it and click “Install” button.

Virtual Usb Drive Mac Computer

Then the agreement form appears, scroll it to the very bottom and click “I Agree” button below.

Soon afterwards the confirmation message is displayed on the screen with the note regarding the installing of VirtualBox extension pack, and new line appears in the list of additions being installed.

Now the setting up routine is over and we may continue with the basic procedure.

How to use USB drives in VirtualBox guest OS?

The latest VirtualBox version supports USB 3.0 devices. In order to be capable to get the whole bonuses of using USB 3.0 speeds, you will have to install Extension Pack, as we defined it earlier. Otherwise, the maximum transfer speed of the data will be equal to 12 Mbit/s, which is valid for USB 1.0 controller. In other case, the USB-disk may not be initialized at all, so let’s not forget about such a circumstance.

At first, before running the virtual machine, address to the main menu of the VM and open the “Settings” category, appropriate for the used machine instance. When the form opens, move to the “USB” section and put on the “Enable USB Controller” and “USB 2.0 (EHCI) Controller” checkboxes. Also create a filter for the required USB-device, specifying it in the list of all available USB-drives, either external hard disks or flash-drives.

Now boot the virtual machine, and when the instance will be initiated, click Devices -> USB in the upper menu and select the proper USB-device which you want to use in the VM.

After that the USB-drive will be immediately attached and initialized.

Usb Flash Drive For Mac

How to boot OS from USB on VirtualBox?

Whatever weird it may seem to you, but you may boot guest OS from USB-drive on VirtualBox. Lower I will present the instruction how to do it from Windows host.

Actually, booting from USB is a hidden feature in VirtualBox, which guarantees raw access to drives. This functionality isn’t available in app basic interface, but it’s a part of the VBoxManage command.

The first step, which you should perform prior to booting the external OS from USB-drive, is to connect the appropriate USB-drive with OS installed in it, to the PC. Use Windows + R hotkey combination, type diskmgmt.msc in the Run dialog form and press Enter button. As a result, the Disk Management window will be opened.

Search the USB drive in the Disk Management form and remember the disk number, corresponding to it. For instance, in my case, the USB drive is Disk 1.

Now, close any opened VBox application forms.

After that, open a Command Prompt with Administrator permissions. On Windows 10, use Windows + X combination on the keyboard and select Command Prompt (Admin) item from the menu.

Virtual Usb Drive Mac

Create Bootable Usb Drive Mac

Virtual Usb Drive Mac

Enter the mentioned command into the command line and press Enter button. This command is dedicated to changing the active path to the VirtualBox default installed path. If you set up the app into the different folder, you will have to specify your own directory instead of mentioned in the example.cd %programfiles%OracleVirtualBox

Enter the defined command in the command line, replacing # sign with the number of the disk you noted earlier in the Disk Management form, and then press Enter button.

VBoxManage internalcommands createrawvmdk –filename C:usbdisk.vmdk -rawdisk .PhysicalDrive#

Instead of C:usbdisk.vmdk you can specify any path you desire. As a result of this command, the VMDK-file will be created, which points to the physical drive you select. After you load the VMDK-object as a drive in VirtualBox, actually the VM will get access to the physical disk of your HDD.

After this iteration is completed, open VirtualBox as administrator. Make a right click on the app shortcut and choose Run as administrator in the context menu. The virtual machine may get access to raw disk drives only with admin rights.

Generate a new VM instance by clicking the New button and process the wizard steps. Choose the OS on the USB-drive when the prompt appears.

When the request is standing visible on the screen to define a hard disk, choose Use an existing virtual hard drive file option, make a click on the button to select a file on the hard disk, and search it – that will be C:usbdisk.vmdk if you didn’t specify your unique path.

Load the VM and as a consequence the OS from your USB-device should load, in the same way as if you were loading it on a standard PC.

Pay attention to the following fact: the USB device should be the first hard disk in your VM settings, otherwise VirtualBox won’t load from it. Talking in another words, you are not able just to generate a default VM and attach a USB-drive afterwards.

If you are willing to install an OS from the USB, you would require to attach a hard drive later from the VM’s settings form. Make sure that USB logical device is the first drive in the list.

As you can see, beforehand I precisely described, how to use USB devices in VirtualBox. This article will surely come in hand, if you decide to boot from USB in VirtualBox or to attach an external USB drive to the VM.