Linux - Virtualization and CloudThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.