LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 10-19-2016, 01:01 AM   #1
bobatnet
LQ Newbie
 
Registered: Oct 2016
Posts: 2

Rep: Reputation: Disabled
Question USB device as a VM Guest


I want to have a linux VM guest that can present itself to the host as a USB device. Specifically, I want to be able to use the USB gadget api for linux on the guest, so that, loading g_mass_storage (kernel module for linux as usb mass storage device), will talk to a usb device controller on the guest and present a usb mass storage device on the bus.

Virtualbox probably won't help much, because it connects to the host via a virtual usb hub. Here, its required to have a usb device controller on the guest.
 
Old 10-26-2016, 03:19 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Hello and welcome to LQ.


If I get the question correctly, you are asking about a usb passthrough in a virtual machine. Some of them can do that and your host may need to have support for it too.

I could be not understanding the question however too.
 
Old 10-27-2016, 03:54 AM   #3
bobatnet
LQ Newbie
 
Registered: Oct 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
In a physical system, attaching a USB keyboard would mean that, a chip with USB device controller functionality is attached to the USB hub of the host. My objective, here, is to have this USB keyboard as a VM guest. The gadget api has linux modules that can emulate several USB classes if the hardware has a usb controller. I need a guest which, with this gadget api, can emulate an usb device and present itself to the host.

Here, the guest needs a virtual usb controller. Also, I think a virtual hub on the host is required that is virtually connected to the guest's usb controller.

A usb passthrough would mean that a device connected to the host's hub is passed on to the guest's virtual hub, which I do not want.

Can this be done?
 
Old 10-27-2016, 06:30 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
No, you can't. "is to have this USB keyboard as a VM guest."


In your example a usb keyboard reports to the host hardware, OS and to the VM as such. It is coded to work as a keyboard and work transparently to the vm client. Unless you code qemu to act like you want, I rather doubt you can get a usb keyboard to connect to the client as a usb device (without passthrough.) If I recall the vm presents a ps/2 keyboard to the client. You'd have to check on that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Guest fails detecting USB device satimis Linux - Virtualization and Cloud 5 09-19-2014 08:32 AM
[SOLVED] USB device not recognized on guest OS PrayingMantis Linux - Virtualization and Cloud 1 11-25-2012 09:07 AM
USB drive not working properly, read only device? (USB key storage device) Arodef Linux - Hardware 14 01-01-2010 07:32 AM
OS Ubuntu 9.04 VMware on guest USB device not working zeusthegod Linux - General 0 08-07-2009 02:16 PM
Windows XP Host with Ubuntu 7.10 Guest - USB device issue Irene Chan Linux - Newbie 3 02-25-2008 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration