CN102567074B - USB (universal serial bus) device redirecting method facing virtual machines - Google Patents

USB (universal serial bus) device redirecting method facing virtual machines Download PDF

Info

Publication number
CN102567074B
CN102567074B CN201110386667.6A CN201110386667A CN102567074B CN 102567074 B CN102567074 B CN 102567074B CN 201110386667 A CN201110386667 A CN 201110386667A CN 102567074 B CN102567074 B CN 102567074B
Authority
CN
China
Prior art keywords
physical machine
usb
usb device
machine
virtual machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110386667.6A
Other languages
Chinese (zh)
Other versions
CN102567074A (en
Inventor
兰雨晴
刘铭
宋潇豫
张永军
夏颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Win win cloud Information Technology Co., Ltd.
Original Assignee
China Standard Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Standard Software Co Ltd filed Critical China Standard Software Co Ltd
Priority to CN201110386667.6A priority Critical patent/CN102567074B/en
Publication of CN102567074A publication Critical patent/CN102567074A/en
Application granted granted Critical
Publication of CN102567074B publication Critical patent/CN102567074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A USB (universal serial bus) device redirecting method facing virtual machines includes the steps: (1) utilizing a simulator QEMU which is on a remote physical machine B and added with a USB device redirecting system to create one virtual machine, and enabling a local physical machine A to access to the virtual machine by means of a remote desktop protocol; (2) utilizing a physical machine C of a USB device to realize communication between the USB device and the virtual machine on the remote physical machine B by the aid of a USB redirecting protocol; and (3) utilizing the remote physical machine B to redirect the USB device on the physical machine C into one designated virtual machine on the remote physical machine B through a command line interface of the simulator QEMU, so that the local physical machine A can utilize the USB device in a remote desktop. The method is applicable to all the virtual machines created by the simulator QEMU added with the USB device redirecting system, and the USB devices are redirected by the aid of the USB redirecting protocol.

Description

A kind of USB device reorientation method of Virtual machine
Technical field
The present invention relates to the method for the USB device in a kind of virtual machine access Local or Remote physical machine created by simulator QEMU, be espespecially a kind ofly redirected by transmission control protocol socket (TCP Socket) and USB the method that the USB device in appointment physical machine to be redirected to designated virtual machine by agreement.
Background technology
The IBM large computer system that virtual (Virtualization) technology appears at the sixties in 20th century the earliest.Along with multiple nucleus system, cluster, the grid even widespread deployment of cloud computing in recent years, the advantage of Intel Virtualization Technology in business application embodies day by day, not only reduce IT cost, but also enhancing security of system and reliability, virtualized concept is also deep into the daily work of people gradually with life.But also there are problems in the use procedure of Intel Virtualization Technology.
USB is a kind of novel serial line interface, and compared with legacy interface, USB has numerous features such as speed is fast, independently-powered, plug and play, cost are low, has boundless range of application.But because the definition of its device category is various, Communications Protocol Specification is complicated, cause USB device Simulation Software Design intricate operation, development difficulty is larger.As everyone knows, printer, flash memory, the USB device such as portable hard drive, digital camera is very important concerning user.And in existing Intel Virtualization Technology, utilizing the virtual machine USB device of accessing in local physical machine also to there is a lot of problem, the Intel Virtualization Technology as much increased income still does not support the access to USB device, or only supports the access to limited several USB device; And although some business paying virtualization softwares improve than virtualization software of increasing income the support of USB device, but still having some limitations property.As virtual server (Hyper-V Server) and the virtual machine (Virtual PC) of himself of current Microsoft, still do not support the access of USB device, need by third-party charging software as network USB (USB Over Network) etc., by Web vector graphic USB device.The desktop virtual machine of VMWare company can use various USB device by configuration from desktop, when using this function, can access the USB device that most of native client end system connects from customer menu.But there is following limitation in the USB redirection function of VMWare company desktop virtual machine:
1, from customer menu, access USB device and in desktop, use this equipment time, this equipment (1 access can only be had) cannot be accessed on the local computer simultaneously;
If 2 from browsing entrance access desktop, then can only use this function on window client, and need the assembly be redirected with optional USB has been installed in advance in local Windows system;
3, will use USB printer in desktop, user must install required print driver in desktop.
And the free virtual machine of VMware company still lacks the support that USB is redirected now.
For utilizing virtual machine to access USB device on remote physical machine, the virtualization software that the virtualization software of no matter increasing income or business are paid, up to the present or a blank.
Want the development difficulty reducing virtual machine, reduce system consumption, improve versatility, make full use of existing driver, virtual machine is enable to access USB device in Local or Remote physical machine, study that to be redirected by transmission control protocol socket and USB the method that agreement combines be best mode, also there is important practice significance simultaneously.
Summary of the invention
For increase income and business paying virtualization software to the limitation of the local USB device of access, and the problem of USB device also on unrealized access remote physical machine, the present invention proposes a kind of USB device reorientation method of Virtual machine.
Simulator QEMU is a platform virtualization solution, allows to carry out virtual (comprising disk, graphics adapter and the network equipment) a complete PC environment.Any I/O request that client operating system generates all can be intercepted and captured halfway, and is again sent in the user model of QEMU process simulation.This method is exactly the redirection function adding USB device on the basis of simulator QEMU, and communicates with Local or Remote physical machine, thus the virtual machine realizing being created by simulator QEMU is to the access of the USB device in Local or Remote physical machine.
In order to realize above-mentioned functions, virtual machine USB reorientation method provided by the invention comprises the following steps:
1) revise simulator QEMU, add USB redirection function.Utilize this simulator QEMU to create QEMU virtual machine, the arbitrary physical machine in LAN (Local Area Network) accesses the QEMU virtual machine in this physical machine by RDP;
2) USB in the physical machine of USB device place is utilized to be redirected communication between protocol realization USB device and far-end QEMU virtual machine;
3) far-end QEMU virtual machine by command line instructions by step 2) in USB device be redirected in virtual machine.
Wherein step 1) comprise following concrete steps:
11) definition is for representing the structure of the USB device that needs are redirected;
12) function performance such as reading and writing, inquiry in order to operate this structure is realized;
13) module of carrying out with the distance host at USB device place communicating is realized;
14) utilize the simulator QEMU adding USB redirection function to create virtual machine, and carry out long-range connection.
Wherein step 12) detailed process be the particular type first judging data manipulation, then perform corresponding handling function according to data manipulation type.
Wherein step 2) in utilize order line command adapted thereto to obtain to need to carry out supplier ID and the product ID of the USB device be redirected, and in the physical machine at USB device place, start the server end process that a USB device is redirected agreement, then a port number assignment is given supplier ID and the product ID of this USB device, and this port is monitored.
Wherein step 3) in first obtain the supplier ID of USB device and the IP address of product ID and place physical machine thereof; Then by command line instructions, this USB device is redirected in far-end QEMU virtual machine in the monitor of far-end QEMU virtual machine.
Then utilize step 2), step 3) in the transmission control protocol socket that establishes carry out data transmission.
The present invention mainly comprises USB and is redirected agreement and USB device Redirectional system two parts based on simulator QEMU.Wherein USB is redirected agreement is that USB device in physical machine distributes a listening port, and starts to monitor this port; Set up transmission control protocol socket with far-end QEMU virtual machine to be connected simultaneously; Then the QEMU virtual machine receiving far-end, to the action type of USB device, operates USB device in physical machine accordingly according to different action types.And based on the USB device Redirectional system of simulator QEMU, the USB device on the main frame of given IP address is redirected in QEMU virtual machine, then receive by the operation of remote desktop to USB device in virtual machine, and by this operational feedback to the physical machine at USB device place; After USB device place physical machine processes assigned operation, result is sent back virtual machine, virtual machine simulates the data after the physical machine process of USB device place again, and reappears in virtual machine.
Technique effect of the present invention is, solves and increases income and the limitation of business paying virtualization software to the local USB device of access, and having filled up increases income cannot access the blank of the USB device on remote physical machine with business paying virtualization software.
Accompanying drawing explanation
Fig. 1 is the configuration diagram that USB device is redirected;
Fig. 2 is the processing flow chart that USB device is redirected agreement.
Embodiment
Clearer understanding is obtained for making feature of the present invention and advantage, below in conjunction with accompanying drawing, be described in detail below: as shown in Figure 1, describe framework of the present invention, by the virtual machine on the RDP access physical host B on physical host A, virtual machine now on physical host B needs to access the USB device (USB device on physical host C and USB are redirected agreement and also can be positioned on physical host A) on physical host C, and the concrete execution step in the present embodiment is:
1) utilize the simulator QEMU adding USB redirection function to create virtual machine, physical machine A is by the virtual machine on RDP access physical machine B;
2) USB device on physical machine C is utilized to be redirected communication between the USB device on protocol realization physical machine C and the virtual machine on physical machine B;
3) USB device on physical machine C to be redirected to by command line instructions in the virtual machine on physical machine B by the virtual machine on physical machine B.
4) by the USB device in the virtual machine on the remote desktop operation physical machine B on physical machine A.
Wherein step 1) in simulator QEMU, add USB redirection function, utilize a structure to represent the USB device that needs are redirected; Utilize the virtual machine that this QEMU creates, QEMU can determine current virtual machine configuration status and to the action type of USB device different types of data as control flow check data, filestream data, interrupt flow data etc., and these information beds is given the physical host C at USB device place.
Wherein step 2) need to utilize instruction acquisition needs to carry out supplier ID and the product ID of the USB device be redirected in order line, and on physical machine C, start the server end process that a USB device is redirected agreement, then a port number assignment is given supplier ID and the product ID of this USB device, and this port is monitored.Step 1) in simulator QEMU obtain the operation information that virtual machine carries out the USB device be redirected to wherein after, be redirected agreement by USB and send it to physical host C.After physical host C processes by result feedback to the simulator QEMU on physical host B; And the result be presented on after the namely process in virtual machine.
Wherein step 3) first obtain the supplier ID of USB device and the IP address of product ID and place physical machine; Then by command line instructions, the USB device of local host is redirected in far-end virtual machine in the monitor of far-end virtual machine.
Wherein step 4) on local physical machine A, utilize remote desktop to access virtual machine on remote physical machine B, and the USB device on the physical machine C be redirected in this virtual machine is read, write, the operations such as deletion, action type feeds back to the virtual machine on physical machine B by RDP, physical machine B is again by step 2) in the connection set up corresponding operating is sent to the physical machine C at USB device place, after physical machine C makes corresponding process, result is sent to the virtual machine on physical machine B, also corresponding result is presented by the remote desktop on physical machine A.
USB in the present invention is redirected agreement: this agreement is made up of following three parts:
1) USB device module usb-device: representative needs the USB device be redirected;
2) USB client module usb-guest: connect usb-device, and assigned operation is carried out to usb-device;
3) USB server end module usb-host: by network by usb-device in dedicating remote virtual machine to, and usb-device can be used to usb-guest.
This agreement is run a server end USB and is redirected usbredirserver process on physical machine C, and for needing the USB device be redirected to distribute a listening port, and start to monitor this port; Set up transmission control protocol socket with the virtual machine created by simulator QEMU on far-end physical machine B to be connected simultaneously; Then the various operation requests to USB device that send of sink virtual machine, to have carried out result feedback these requests after corresponding process to the virtual machine on far-end physical machine B until physical machine C.
USB device Redirectional system based on simulator QEMU: amendment simulator QEMU, add USB and be redirected connection usbredir-tcp module, be responsible for being redirected the usbredirserver process that agreement starts with USB to be connected, result is sent to corresponding part after processing the information obtained from virtual machine or usbredirserver process by part.By the USB device information of acquisition, the IP address of USB device place physical machine, in the virtual machine created by simulator QEMU utilizing command line instructions the USB device on physical machine C to be redirected on physical machine B, physical machine A utilizes the virtual machine on remote desktop access physical machine B, and the USB device be redirected on this virtual machine is operated; After these operations return to the virtual machine on physical machine B, the physical machine C that physical machine B utilizes USB device Redirectional system to send it to USB device place again processes accordingly.
Technique effect of the present invention is, solves and increases income and the limitation of business paying virtualization software to the local USB device of access, and having filled up increases income cannot access the blank of the USB device on remote physical machine with business paying virtualization software.

Claims (6)

1. a USB device reorientation method for Virtual machine, is characterized in that: it comprises the following steps:
1) virtual machine of local physical machine A by RDP access far-end physical machine B is created by the simulator adding USB device Redirectional system;
2) communication between the virtual machine utilizing the USB on the physical machine C at USB device place to be redirected on protocol realization USB device and far-end physical machine B;
3) USB device on physical machine C redirects in the designated virtual machine on far-end physical machine B by the command line instructions of simulator by far-end physical machine B;
4) local physical machine A is by the designated virtual machine on remote desktop access far-end physical machine B, and the USB device on operation is redirected in this virtual machine physical machine C;
Wherein:
USB is redirected agreement, and this agreement is made up of following three parts:
1) USB device usb-device module: representative needs the USB device be redirected;
2) USB client usb-guest module: connect usb-device, and assigned operation is carried out to usb-device;
3) USB server end usb-host module: by network by usb-device in dedicating remote virtual machine to, and usb-device can be used to usb-guest;
This agreement runs a usbredirserver process on physical machine C, and for needing the USB device be redirected to distribute a listening port, and start to monitor this port; Set up transmission control protocol socket with the virtual machine created by simulator QEMU on far-end physical machine B to be connected simultaneously; Then the various operation requests to USB device that send of sink virtual machine, to have carried out result feedback these requests after corresponding process to the virtual machine on far-end physical machine B until physical machine C;
USB device Redirectional system based on simulator QEMU is: amendment simulator QEMU, add USB and be redirected connection usbredir-tcp module, be responsible for being redirected the usbredirserver process that agreement starts with USB to be connected, a part for the information obtained from virtual machine or usbredirserver process is processed, result is sent to corresponding part, by the USB device information obtained, the IP address of USB device place physical machine, in the virtual machine created by simulator QEMU utilizing command line instructions the USB device on physical machine C to be redirected on physical machine B, physical machine A utilizes the virtual machine on remote desktop access physical machine B, and the USB device be redirected on this virtual machine is operated, after these operations return to the virtual machine on physical machine B, the physical machine C that physical machine B utilizes USB device Redirectional system to send it to USB device place again processes accordingly.
2. the method for claim 1, is characterized in that: in described step 1) in, utilize the simulator QEMU adding USB device Redirectional system to create virtual machine.
3. the method for claim 1, is characterized in that: in described step 1) concrete change be add the method connecting USB device place physical machine, and the judgement of data category involved during operation USB device and disposal route.
4. method as claimed in claim 2, is characterized in that: in described step 2) in, on the physical machine C at USB device place, first obtain supplier ID and the product ID of USB device; Then utilize on physical machine C USB be redirected agreement for this reason USB device distribute a listening port, and run a server end USB and be redirected usbredirserver process and start to monitor this port; The virtual machine created by simulator QEMU on far-end physical machine B is set up transmission control protocol socket with the usbredirserver process on physical machine C and is connected.
5. method as claimed in claim 2, is characterized in that: in described step 3) in, first obtain the supplier ID of USB device on physical machine C and the IP address of product ID and physical machine C; By command line instructions, the USB device on physical machine C is redirected in the designated virtual machine on far-end physical machine B in the monitor of the virtual machine then created by simulator QEMU on far-end physical machine B.
6. method as claimed in claim 2, it is characterized in that: in described step 4) in, local physical machine A utilizes the virtual machine on remote desktop access remote physical machine B, and the USB device on the physical machine C be redirected in this virtual machine is read, write, deletion action, action type feeds back to the virtual machine on physical machine B by RDP, physical machine B is again by step 2) in the connection set up corresponding operating is sent to the physical machine C at USB device place, after physical machine C makes corresponding process, result is sent to the virtual machine on physical machine B, corresponding result is presented by the remote desktop on physical machine A.
CN201110386667.6A 2011-11-29 2011-11-29 USB (universal serial bus) device redirecting method facing virtual machines Active CN102567074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110386667.6A CN102567074B (en) 2011-11-29 2011-11-29 USB (universal serial bus) device redirecting method facing virtual machines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110386667.6A CN102567074B (en) 2011-11-29 2011-11-29 USB (universal serial bus) device redirecting method facing virtual machines

Publications (2)

Publication Number Publication Date
CN102567074A CN102567074A (en) 2012-07-11
CN102567074B true CN102567074B (en) 2015-01-21

Family

ID=46412572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110386667.6A Active CN102567074B (en) 2011-11-29 2011-11-29 USB (universal serial bus) device redirecting method facing virtual machines

Country Status (1)

Country Link
CN (1) CN102567074B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105100157B (en) * 2014-05-15 2019-08-27 中兴通讯股份有限公司 A kind of USB device mapping, exchange method, device, cloud terminal and Cloud Server
CN103984590A (en) * 2014-06-03 2014-08-13 浪潮电子信息产业股份有限公司 Virtual machine USB-equipment sharing method
CN104092747B (en) * 2014-06-30 2017-08-08 新华三技术有限公司 USB dynamic connection methods and device under virtualized environment
CN105740180B (en) * 2014-12-10 2019-08-02 中国移动通信集团重庆有限公司 The virtual machine cut-in method and device of USB device
CN104991871A (en) * 2015-06-15 2015-10-21 湖南昇云科技有限公司 Method and system for redirecting cloud terminal USB
CN105183675B (en) 2015-09-30 2018-03-27 华为技术有限公司 To the access method of USB device, device, terminal, server and system
CN105391652B (en) * 2015-12-03 2018-08-31 武汉噢易云计算股份有限公司 The system and method for realizing USB device network share is redirected based on USB
CN105843612A (en) * 2016-03-21 2016-08-10 深圳市京华科讯科技有限公司 Method for switching virtual machines by terminal device and terminal device
CN106445847A (en) * 2016-09-12 2017-02-22 天脉聚源(北京)传媒科技有限公司 U disk SN code obtaining method and device
CN107643936A (en) * 2017-10-26 2018-01-30 上海金途信息科技有限公司 A kind of image class peripheral data Redirectional system based on QEMU camera devices
CN108304247A (en) * 2017-12-19 2018-07-20 华为技术有限公司 The method and apparatus of access camera, server, readable storage medium storing program for executing
CN108108201A (en) * 2017-12-26 2018-06-01 合肥中科云巢科技有限公司 USB storage device reorientation method and virtual machine based on RDP agreements
CN109857465A (en) * 2018-11-23 2019-06-07 广东微云科技股份有限公司 A kind of automatic installation method and system of cloud desktop usb driving
CN110109623B (en) * 2019-04-30 2022-08-16 广州长图量传电子科技有限公司 Method for realizing remote operation of USB flash disk of KVM system
CN112231004B (en) * 2020-10-19 2022-06-17 北京京航计算通讯研究所 Cloud desktop terminal USB redirection system
CN112596793B (en) * 2020-11-26 2022-04-01 新华三大数据技术有限公司 Redirection method and device for composite equipment
CN116955236B (en) * 2023-09-20 2023-12-12 元内核(北京)科技有限公司 USB device sharing method and system based on virtualization

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035039A (en) * 2007-04-20 2007-09-12 福建升腾资讯有限公司 USB mapping method
CN101493786A (en) * 2008-01-22 2009-07-29 联想(北京)有限公司 Computer and equipment accessing method
CN102023960A (en) * 2009-09-14 2011-04-20 联想(北京)有限公司 Computer network system, computer and hardware equipment remote management method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294457A1 (en) * 2006-06-16 2007-12-20 Alexander Gantman USB wireless network drive

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035039A (en) * 2007-04-20 2007-09-12 福建升腾资讯有限公司 USB mapping method
CN101493786A (en) * 2008-01-22 2009-07-29 联想(北京)有限公司 Computer and equipment accessing method
CN102023960A (en) * 2009-09-14 2011-04-20 联想(北京)有限公司 Computer network system, computer and hardware equipment remote management method thereof

Also Published As

Publication number Publication date
CN102567074A (en) 2012-07-11

Similar Documents

Publication Publication Date Title
CN102567074B (en) USB (universal serial bus) device redirecting method facing virtual machines
US9906584B2 (en) Terminal device, system, and method for accessing virtual desktop
CN106843715B (en) Touch support for remoted applications
JP6004608B2 (en) Method, apparatus, and computer program for virtualizing host USB adapter (virtualization of host USB adapter)
CN101430649B (en) Virtual computation environmental system based on virtual machine
US20130219090A1 (en) System and method for virtualizing the peripherals in a terminal device to enable remote management via removable portable media with processing capability
CN104199723B (en) Camera mapping method based on virtual equipment
CN103986786A (en) Remote cloud desktop operation system
CN103425511A (en) System and method of installing and deploying application software in cloud computing environment
US9336032B2 (en) Zoning data to a virtual machine
CN104636076A (en) Distributed block device driving method and system for cloud storage
CN107580011B (en) Data sharing method and desktop cloud server
WO2022143714A1 (en) Server system, and virtual machine creation method and apparatus
CN103677970A (en) System and method for achieving combination display of terminal local desktop and far-end virtual desktop
WO2016058560A1 (en) External acceleration method based on serving end and external buffer system for computing device, and device implementing said method
CN103227825A (en) Desktop all-in-one machine framework
US20200326998A1 (en) Two-way clipboard exchange in virtual console
US20220207165A1 (en) Information processing method, system, electronic device and computer readable storage medium
US20130326501A1 (en) Cloud system having flexible applications
CN113010470A (en) Edge node remote control system, method, device and storage medium
CN101826061A (en) Shared system and management method of hardware device
CN107247618A (en) A kind of disk reorientation method under the outside acquisition framework based on instruction
US10664292B2 (en) Web-based graphical user interface display system
CN113138946B (en) USB data mapping filtering method and device based on embedded Linux
Wan et al. Design ideas of mobile internet desktop system based on virtualization technology in cloud computing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20170213

Address after: 430079 Hubei Province, East Lake New Technology Development Zone, Optics Valley Avenue, No. nine cable expansion (phase five) cable factory building (building 101), room 388

Patentee after: Wuhan Kwangwoon Core Information Technology Co. Ltd.

Address before: 200030 room 1006-1010, Panyu Road, Shanghai, 1028

Patentee before: China Standard Software Co., Ltd.

CP01 Change in the name or title of a patent holder

Address after: 430079 Hubei Province, East Lake New Technology Development Zone, Optics Valley Avenue, No. nine cable expansion (phase five) cable factory building (building 101), room 388

Patentee after: Win win cloud Information Technology Co., Ltd.

Address before: 430079 Hubei Province, East Lake New Technology Development Zone, Optics Valley Avenue, No. nine cable expansion (phase five) cable factory building (building 101), room 388

Patentee before: Wuhan Kwangwoon Core Information Technology Co. Ltd.

CP01 Change in the name or title of a patent holder