On a Windows 10 host I have an Android x86 VM and a CentOS 7 VM. I have Android Studio installed in the CentOS VM and would like to deploy an app to the Android x86 VM. With a real Android device I would do this via USB. So, what I would like to do is connect the two VMs via virtual USB so that I can deploy to & debug on the virtual Android device.
FWIW, I'm using the Android x86 VM because the Android emulator in the CentOS VM is too slow to be useful.
How do I connect two VMs via virtual USB?
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How do I connect two VMs via virtual USB?
Not possible. USB was not designed for connecting two hosts.
-
jcejohnson
- Posts: 4
- Joined: 18. May 2015, 20:35
Re: How do I connect two VMs via virtual USB?
Fair enough. But the port on the Android device isn't a device port, not a host port. I guess the answer, then, is that virtualbox doesn't emulate device ports?
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: How do I connect two VMs via virtual USB?
I'm not quite sure I understand the above statement. Could you clarify?jcejohnson wrote:But the port on the Android device isn't a device port, not a host port.
Since there are no Guest Additions (GAs) for Android (heck Android is not even a supported guest), you cannot use shared folders. And as Michal pointed out, there's no shared USB.
You can either use an FTP client from Android (is there one?) to log to an FTP server on your host and transfer your files like that, or use a "common" 3rd storage device where you store your app from your host, and access it from your guest. That means that at a minimum, you have to mount the common vdi, copy your app, shut down the CentOS VM, launch the Android VM, copy the app, rinse and repeat. I believe the former is more straightforward.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
jcejohnson
- Posts: 4
- Joined: 18. May 2015, 20:35
Re: How do I connect two VMs via virtual USB?
Clarity:
On a physical Android device, the USB port is a device port (the same as a thumb drive, camera, etc.) whereas on a computer the USB port is a host port. A host port initiates communication, a device port responds. Somebody else can explain that better than I: http://electronics.stackexchange.com/qu ... and-device
When an Android device is plugged into a computer where adb (android debug bridge) is installed, adb will establish a connection to the device and can then copy files, deploy applications, etc. During development, that link can be used to debug running apps. My hope was that a virtualbox-hosted Android x86 instance would be able to present a USB device port (the same as physical hardware does) such that the virtualbox host or, ideally, another guest would be able to connect to it via adb.
Shared folders, ftp, etc. doesn't come into the picture -- those are or would be good ways to get files/apps onto the device but wouldn't support live debugging. However, adb-over-tcp is an option. I wanted to avoid that for other reasons but they aren't good reasons so that's probably the direction I will go.
On a physical Android device, the USB port is a device port (the same as a thumb drive, camera, etc.) whereas on a computer the USB port is a host port. A host port initiates communication, a device port responds. Somebody else can explain that better than I: http://electronics.stackexchange.com/qu ... and-device
When an Android device is plugged into a computer where adb (android debug bridge) is installed, adb will establish a connection to the device and can then copy files, deploy applications, etc. During development, that link can be used to debug running apps. My hope was that a virtualbox-hosted Android x86 instance would be able to present a USB device port (the same as physical hardware does) such that the virtualbox host or, ideally, another guest would be able to connect to it via adb.
Shared folders, ftp, etc. doesn't come into the picture -- those are or would be good ways to get files/apps onto the device but wouldn't support live debugging. However, adb-over-tcp is an option. I wanted to avoid that for other reasons but they aren't good reasons so that's probably the direction I will go.
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: How do I connect two VMs via virtual USB?
OK, thanks for the clarification. Kind of makes sense.
If you ever manage to get adb-over-tcp to work, it wouldn't hurt if you were to post the solution here as well for completion. Some future user might benefit from it...
If you ever manage to get adb-over-tcp to work, it wouldn't hurt if you were to post the solution here as well for completion. Some future user might benefit from it...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
michaln
- Oracle Corporation
- Posts: 2973
- Joined: 19. Dec 2007, 15:45
- Primary OS: MS Windows 7
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Any and all
- Contact:
Re: How do I connect two VMs via virtual USB?
In theory, probably yes. Is anyone bored enough to put a few man-weeks of work into it, probably not.jcejohnson wrote:My hope was that a virtualbox-hosted Android x86 instance would be able to present a USB device port (the same as physical hardware does) such that the virtualbox host or, ideally, another guest would be able to connect to it via adb.