I am running Windows7 on my laptop and have successfully downloaded compiled programs/sketches onto an Arduino Uno via a USB port, as per the book 'Getting Started with Arduino'.
However, when I run up an Ubuntu 11.10 virtual machine using VirtualBox4.1.6 and try downloading the same sketches to the same Arduino board through the same physical USB port, it fails, the Arduino IDE software complaining 'avrdude: stk500_recv(): programmer is not responding'.
The problem appears to be a failure by the host (Windows7) to 'pass through' the detection of the USB connected device to the guest (Ubuntu11.10).
In VirtualBox Manager, the USB Device Filter properties for Ubuntu identify Port 11, which is the port in the Windows host upon which the Arduino appears, but I cannot associate the guest COM1 serial port with the host COM11 port.
When I try to do so in the Serial Port Settings in VirtualBox, startup of the virtual machine fails, throwing error - Failed to open host device 'COM11'.
If I disable the serial ports and run up the Ubuntu guest and execute the lsusb command with the Arduino board connected I get -
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
- but the Arduino IDE still throws the error.
I want to persevere with the Ubuntu environment, but where do I go from here?
Failure of USB port in Ubuntu guest on Windows7 host
-
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: Failure of USB port in Ubuntu guest on Windows7 host
Simulating virtual hardware (in this case a USB controller) adds an unusually high latency (relative to physical hardware). Latency in this case basically means a longer trip time for a result to come back. Anything that is fussy about the latency will fail. I assume you are talking about a USB/JTAG debug header adapter, and that is certainly one of the devices that would top my list of "expect trouble with". This is by no means an established fact, but your experience doesn't surprise me at all.
Now, being (I believe) based on open tools, the Arduino might be using USB library software whose timing you could play with, to get it to work. You'd have to ask about that on the Arduino forums though.
Have you had success getting other USB devices working in VMs?
Now, being (I believe) based on open tools, the Arduino might be using USB library software whose timing you could play with, to get it to work. You'd have to ask about that on the Arduino forums though.
Have you had success getting other USB devices working in VMs?
Re: Failure of USB port in Ubuntu guest on Windows7 host
I will raise a thread on an Arduino forum, but will try some other USB device and let you know, thanks.
Re: Failure of USB port in Ubuntu guest on Windows7 host
Tried a USB Mass Storage Device (from PNY) on both host and guest - both working fine using same physical port that succeeds with the Arduino board in Windows7 but fails under Ubuntu guest.
In Ubuntu guest the lsusb command gives -
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 154b:0054 PNY
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Replacing the MSD with Arduino board, lsusb gives -
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
The guest OS clearly recognises a 'conventional' usb device, but fails to detect the Arduino microcontroller board.
Having narrowed it down to this, I think I need to try the Arduino forum as you suggest, thanks again.
In Ubuntu guest the lsusb command gives -
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 154b:0054 PNY
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Replacing the MSD with Arduino board, lsusb gives -
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
The guest OS clearly recognises a 'conventional' usb device, but fails to detect the Arduino microcontroller board.
Having narrowed it down to this, I think I need to try the Arduino forum as you suggest, thanks again.
-
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: Failure of USB port in Ubuntu guest on Windows7 host
I assume you've done the needful inside the Ubuntu guest to allow your user to access USB? I'm talking about the internal (Linux guest) configuration details discussed in the user manual, section 3.10.2 (i.e. membership of "vboxusers" group).
Re: Failure of USB port in Ubuntu guest on Windows7 host
Checked out Section 3.10.2 of the VirtualBox manual. I am using a Windows7 host - the guidance regarding being a member of vboxusers group relates to Linux hosts, not guests. Following your advice to try another usb device, I connected a mass storage device (a PNY 8Gbyte memory stick) and was able to touch and edit files on it using the Ubuntu guest, so I believe my virtual usb bus is behaving OK...over to the Arduino forum, I think. Will post eventual solution here if it relates in any way to the VirtualBox setup.
-
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: Failure of USB port in Ubuntu guest on Windows7 host
Oops, sorry, quite right.Sierra wrote:Checked out Section 3.10.2 of the VirtualBox manual. I am using a Windows7 host - the guidance regarding being a member of vboxusers group relates to Linux hosts, not guests.
Re: Failure of USB port in Ubuntu guest on Windows7 host
Success!
After reviewing a number of posts with similar circumstances to the above, I had learned -
i. all content in the VirtualBox Serial Ports settings panel relates to the host (Windows7) ports! (VB help could be more explicit on this)
ii. the colon in the 'Port/File Path:' setting is very significant - it must be included, otherwise the error Failed to open host device 'COMx' is always thrown, no matter what port is identified
iii. some problems have been encountered in Windows hosts when port numbers were in double figures e.g. COMM11
Now, my Arduino Uno board, on connection to the Windows7 host, always appeared on COM11, so I changed that to COM1, then included the colon in the VirtualBox Serial Port Setting reference to it, ran up the Ubuntu guest, started the Arduino IDE, loaded a simple sketch (Blink), chose the only serial port identified in the IDE's Tools/Serial Port option (/dev/ttyS0), and uploaded the compiled programme to the Uno successfully, just as easily as in the pure Windows7 environment!
How to change the port a device appears on in Wndows7? - see Port Renaming attachment.
What are the associated settings for the renamed port in VirtualBox? - see Guest Port Setting attachment.
One final point - the device must be attached on booting up the guest (Linux) O/S, unlike the host (Windows7) O/S which operates in true 'plug n play' mode. That is, Windows7 handles attachment of the device anytime after startup (you can open the Control Panel\Hardware and Sound\Devices and Printers window and see this happen - an icon appears representing the newly opened port naming the attached device), whereas the Ubuntu guest will not boot without the device physically attached before startup - presumably a feature of VB as a guests serial port has to be defined as enabled and associated with a host device, not just a host's port.
After reviewing a number of posts with similar circumstances to the above, I had learned -
i. all content in the VirtualBox Serial Ports settings panel relates to the host (Windows7) ports! (VB help could be more explicit on this)
ii. the colon in the 'Port/File Path:' setting is very significant - it must be included, otherwise the error Failed to open host device 'COMx' is always thrown, no matter what port is identified
iii. some problems have been encountered in Windows hosts when port numbers were in double figures e.g. COMM11
Now, my Arduino Uno board, on connection to the Windows7 host, always appeared on COM11, so I changed that to COM1, then included the colon in the VirtualBox Serial Port Setting reference to it, ran up the Ubuntu guest, started the Arduino IDE, loaded a simple sketch (Blink), chose the only serial port identified in the IDE's Tools/Serial Port option (/dev/ttyS0), and uploaded the compiled programme to the Uno successfully, just as easily as in the pure Windows7 environment!
How to change the port a device appears on in Wndows7? - see Port Renaming attachment.
What are the associated settings for the renamed port in VirtualBox? - see Guest Port Setting attachment.
One final point - the device must be attached on booting up the guest (Linux) O/S, unlike the host (Windows7) O/S which operates in true 'plug n play' mode. That is, Windows7 handles attachment of the device anytime after startup (you can open the Control Panel\Hardware and Sound\Devices and Printers window and see this happen - an icon appears representing the newly opened port naming the attached device), whereas the Ubuntu guest will not boot without the device physically attached before startup - presumably a feature of VB as a guests serial port has to be defined as enabled and associated with a host device, not just a host's port.
- Attachments
-
- Guest Port Setting.zip
- Ubuntu Guest Port Setting
- (73.93 KiB) Downloaded 473 times
-
- Port Renaming.zip
- Windows7 - Port Renaming
- (490.82 KiB) Downloaded 373 times
Re: Failure of USB port in Ubuntu guest on Windows7 host
hi
Have you right too write on serial port into linux guest? you have too xrite on terminal this lines :
sudo su
usermod -a -G tty [userNalme]
usermod -a -G dialout [userNalme]
and restart lunix system.
Have you right too write on serial port into linux guest? you have too xrite on terminal this lines :
sudo su
usermod -a -G tty [userNalme]
usermod -a -G dialout [userNalme]
and restart lunix system.