Overview
- Passthrough: Attach a USB device from a host to a VM instance located on the host. If you want to migrate the VM instance, detach the USB device first.
- Forward: Attach a USB device from a host to a VM instance located in the same zone as the host. If you want to migrate the VM instance, you do not need to detach the USB device.
Prerequisites
Make sure you have installed the latest version of ZStack Cloud and deployed key resources for creating a VM instance.
Add a Host
On the main menu of ZStack Cloud, choose . On the Host page, click Add Host. Then, the Add Host page is displayed.
- Name: Enter a name for the host.
- Description: Optional. Enter a description for the host.
- Virtualization Technology: Select the hypervisor type of
the server. You can select KVM or X-Dragon.
- If the server applies the KVM virtualization technology, select KVM.
- If the server applies the X-Dragon architecture, select X-Dragon.
- Tag: Optional. Attach one or more tags to the host.
- Cluster: Select the cluster where the host is located.
- Host Info: Configure the host information such as the host IP and SSH port according to your actual needs. You can configure the host information by entering an IP address or an IP range.
- Scan Host IOMMU Setting: Optional. Choose whether to scan the IOMMU setting of the host. The IOMMU setting is used in scenarios such as peripheral device passthrough and virtualization. Disable this feature for this scenario.
- Intel EPT Hardware Assist: Optional. Choose whether to enable Intel EPT hardware assist for Intel CPUs to improve the CPU performance. By default, Intel EPT hardware assist is enabled.

View USB Devices
Once you have successfully added a host, ZStack Cloud can automatically recognize USB devices on the host.

Note:
- The default name of a USB device is typically the manufacturer's name followed by a number. You can modify the name by clicking on the right. We recommend that you edit the device name to make a USB device more identifiable.
- The USB version is determined by the port the USB is inserted into. For example, if a USB 3.0 device is inserted into a USB 2.0 port, the displayed USB version will be 2.0.
Attach a USB Device to a VM Instance
Note:
- A USB device can be passed through to only one VM instance at a time.
- A VM instance can have a maximum of one USB 1.0 device, six USB 2.0 devices, and four USB 3.0 devices attached.
- If a VM instance is running or has its local storage disabled, you can only attach USB devices that are connected to the same host as the VM instance.
- If a VM instance uses shared storage and is stopped, you can attach one or more USB devices of a host that is located in the same cluster as the VM instance.
On the main menu of ZStack Cloud, choose . On the VM Instance page, choose a VM instance and enter its details page. Then, choose to enter the details page where you can attach USB devices by clicking Attach. Then, follow these steps:
- Choose the attach mode.You can attach a USB device by passthrough or forwarding.
- Passthrough: Attach a USB device from the host where the VM instance is located to the VM instance. If you want to migrate the VM instance, detach the USB device first.
- Forward: Attach a USB device from the host that is in the same zone as the VM instance to the VM instance. If you want to migrate the VM instance, you do not need to detach the USB device.
Figure 3. Choose Attach Mode 
- Select a USB device.The Select USB Device page displays a list of USB devices filtered according to the attach mode you choose. Select a USB device to be attached to the VM instance and click OK.
Figure 4. Select USB Device 
- Check the attached USB devices.
Launch the console of the VM instance, and run the
lsusbcommand to view all the attached USB devices.Figure 5. Check Attached USB Devices 
Note: You can run yum install usbutilsorapt install usbutilsto install thelsusbcommand. Make sure that the VM instance has access to the public network.
Additional Information
- Edit Device Name: Edit the name of a USB device to make it more identifiable.
- Enable: Enable a USB device. An enabled USB can be attached to a VM instance.
- Disable: Disable a USB device. A disabled USB cannot be attached to a VM instance.
- Attach VM Instance: Pass through a USB device to a VM instance.
- Detach VM Instance: Detach a passed-through USB device from a VM instance.
Install a USB 3.0 Driver (Optional)
Passthrough of USB 3.0 devices is not supported for Windows XP, Windows Server 2003 R2, Windows Server 2008 R2, and Windows 7. To use USB 3.0 devices on these systems, you need to manually install a driver. Download the driver file by clicking the following link and install the driver: http://cdn.zstack.io/tools/renesas_usb30_21390.exe.
Note:
- USB 2.0 devices can be attached to and recognized by both Linux and Windows VM instances.
- USB 3.0 devices can be attached to and recognized by Linux VM instances. To attach USB 3.0 devices to Windows VM instances, specifically, those running Windows XP, Windows Server 2003 R2, Windows Server 2008 R2, and Windows 7, you need to first install the USB 3.0 driver. Alternatively, you can insert the USB 3.0 device into a USB 2.0 port for better recognition.
Typical Scenarios
USB Flash Device
A USB flash device, such as a USB flash drive or a portable hard drive, is a miniature high-capacity storage device that utilizes a USB port and requires no physical driver. Simply by inserting a USB device into a USB port of a computer or server, you can conveniently and quickly exchange data.
As virtualization technology advances, USB passthrough has been introduced to enable USB flash devices, the physical hardware, to directly exchange data with VM instances. With this feature, you can easily access services including data backup, capacity expansion, and quick extension services such as antivirus rescue USB drives.
Security Dongle
A security dongle is a hardware device that provides software protection. If connected to a parallel port or USB port of a computer, it can prevent unauthorized use of software and data, thus safeguarding intellectual property rights. Similar to a license, a security dongle can unlock software functionality and ensure that the software runs as expected.
As virtualization technology advances, you may need to migrate VM instances without interrupting your business. With the USB passthrough feature, you can forward a security dongle to a VM instance. This not only guarantees the stability and continuity of your business but also maintains data security.
