How connect the VM to the host via USB
How connect the VM to the host via USB
I'm running Android 4 in a virtual machine. Running like a little kitten. No problems. But now I find myself with some question marks above my head. I can't figure out how I can connect the VM to the host via USB. Surely, I can connect USB devices from the host to the VM, but I want to connect the VM itself to the host. Just like plugging in your tablet to (in this case) do app development with remote debugging.
How do I do that?
VirtualBox 4.1.16
Host: Windows 7 x64 SP1
Guest: Android 4.0.1-x86, kernel 2.6.29-qemu
How do I do that?
VirtualBox 4.1.16
Host: Windows 7 x64 SP1
Guest: Android 4.0.1-x86, kernel 2.6.29-qemu
I'm probably running the latest everything. Yolo.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How connect the VM to the host via USB
Just connect your hosts USB out cable to your VM. Oh, your host doesn't have one? Well, there's your problem...
Seriously, VirtualBox does not do virtual USB devices. It has a virtual USB controller, to which real devices are attached.
Seriously, VirtualBox does not do virtual USB devices. It has a virtual USB controller, to which real devices are attached.
Re: How connect the VM to the host via USB
I don't understand your response
I don't need a USB controller, and I don't need to attach devices to the VM. I need the reverse: connect the VM as a device.
I don't need a USB controller, and I don't need to attach devices to the VM. I need the reverse: connect the VM as a device.
I'm probably running the latest everything. Yolo.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How connect the VM to the host via USB
You can't do that.
Re: How connect the VM to the host via USB
Okay, then I would hereby like to turn it into an improvement suggestion.
I'm probably running the latest everything. Yolo.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How connect the VM to the host via USB
No point, the suggestion is not practical.
Re: How connect the VM to the host via USB
Why not? I just explained how it would be.
I'm probably running the latest everything. Yolo.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How connect the VM to the host via USB
Given your statement "I don't need a USB controller" I think it would be a waste of my time attempting to explain to you why the idea is not practical. Also you clearly did not take on board that VirtualBox does not include a USB device emulation.
You explained how it could be? I don't see where you explained anything.
You explained how it could be? I don't see where you explained anything.
Re: How connect the VM to the host via USB
Okay, let me try and explain it more clearly.
An operating system may be able to act as a USB device, such as mass storage device, media device, android debug bridge, or other. Such an OS essentially acts as a USB slave and when installed on a machine (virtual or not), a USB-connector can be used to tether it to a PC. This could cause the PC to register a drive letter if the guest OS in question implemented mass storage device.
In VirtualBox practise, this could be used to connect a guest OS as a USB slave to the host OS.
In a VirtualBox example, this could be used to connect the ADB (android debug bridge) from an Android VM via USB to the host, so that a programmer can use the regular ADB interface and Eclipse to connect to it, just as if it were a real Android phone/tablet.
A USB controller is not needed for this on the guest, since a USB controller acts as a USB host, which may only be recommended if mouse input is needed. A slave is at the other end of the (virtual) tether.
I suppose a virtual USB controller is needed for this *on the host*, but I'm not certain. Who knows this can be done in combination with an existing physical USB controller.
An operating system may be able to act as a USB device, such as mass storage device, media device, android debug bridge, or other. Such an OS essentially acts as a USB slave and when installed on a machine (virtual or not), a USB-connector can be used to tether it to a PC. This could cause the PC to register a drive letter if the guest OS in question implemented mass storage device.
In VirtualBox practise, this could be used to connect a guest OS as a USB slave to the host OS.
In a VirtualBox example, this could be used to connect the ADB (android debug bridge) from an Android VM via USB to the host, so that a programmer can use the regular ADB interface and Eclipse to connect to it, just as if it were a real Android phone/tablet.
A USB controller is not needed for this on the guest, since a USB controller acts as a USB host, which may only be recommended if mouse input is needed. A slave is at the other end of the (virtual) tether.
I suppose a virtual USB controller is needed for this *on the host*, but I'm not certain. Who knows this can be done in combination with an existing physical USB controller.
I'm probably running the latest everything. Yolo.
-
Martin
- Volunteer
- Posts: 2562
- Joined: 30. May 2007, 18:05
- Primary OS: Fedora other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: XP, Win7, Win10, Linux, OS/2
Re: How connect the VM to the host via USB
You need to remember that the Virtualbox guest is a virtual PC.
I have never seen a PC providing a USB slave interface.
I have never seen a PC providing a USB slave interface.
Re: How connect the VM to the host via USB
I have now 
Windows 8 tablets. I'm sure they have a USB connector somewhere.
Windows 8 tablets. I'm sure they have a USB connector somewhere.
I'm probably running the latest everything. Yolo.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How connect the VM to the host via USB
Great, now all you need do is write a USB device simulation and donate it to the VirtualBox project - I'm pretty sure it isn't going to happen any other way. Even then I'm not sure who (other than Android developers) is going to prefer this over a simple network interface.
Note that the existing VirtualBox USB feature implements what is effectively a passthrough. Implementing an actual USB device stack would be a different kettle of fish entirely, and I don't see the the return that would justify the investment if the devteam were to consider this, i.e. how much are you willing to pay, and how many others would commit themselves to the same?
Note that the existing VirtualBox USB feature implements what is effectively a passthrough. Implementing an actual USB device stack would be a different kettle of fish entirely, and I don't see the the return that would justify the investment if the devteam were to consider this, i.e. how much are you willing to pay, and how many others would commit themselves to the same?
Re: How connect the VM to the host via USB
I don't know. But it feels like you're yelling at me for wanting a certain feature that may well set VB apart from all the others. Be it minor or not. What you're stating about developer resources, sure it costs a lot of resources, but the same could be said for any minor feature that is hardly ever used (such as custom DNS entries as requested - and fulfilled - in one of my other posts)...
I'm probably running the latest everything. Yolo.
-
mpack
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Mostly XP
Re: How connect the VM to the host via USB
No, I'm not yelling at you - but I do regard it as a poor suggestion. And setting your software apart from others by adding features that nobody (who pays) wants is not something I consider it vitally important to do. Quite the contrary.thany wrote:it feels like you're yelling at me for wanting a certain feature that may well set VB apart from all the others.
IMHO it is almost never a good idea to complicate software by adding minority interest features. If this has been done for you in the past then (a) you were very lucky, (b) it must have been trivially easy, (c) there were no obvious downsides. I believe at least two of these is not true for your USB suggestion.thany wrote:Be it minor or not. What you're stating about developer resources, sure it costs a lot of resources, but the same could be said for any minor feature that is hardly ever used
Re: How connect the VM to the host via USB
So you are saying there's no way in hell or heaven that this feature wil ever make it into virtualbox.
That's different from "we don't have the resources at the moment, so we shall file it as a low-priority request".
The upside that that from what you're saying, it seems the devteam actually consider complexity. I wouldn't have thought that, looking at the sheer number of settings for a VM... I would think that adding a checkbox saying "Enable USB slave" would not be overly complicated, but of course I can't know about the code that sits behind it, since I'm not that kind of programmer.
But let's not let this topic veer offtopic too much, I get the message. It's not gonna happen either way.
That's different from "we don't have the resources at the moment, so we shall file it as a low-priority request".
The upside that that from what you're saying, it seems the devteam actually consider complexity. I wouldn't have thought that, looking at the sheer number of settings for a VM... I would think that adding a checkbox saying "Enable USB slave" would not be overly complicated, but of course I can't know about the code that sits behind it, since I'm not that kind of programmer.
But let's not let this topic veer offtopic too much, I get the message. It's not gonna happen either way.
I'm probably running the latest everything. Yolo.