Page 1 of 1

USB / Serial Passthrough

Posted: 30. Jul 2009, 21:55
by havealoha
Can someone suggest how I get USB 2.0 installed for Win XP or how to pass through / pipe a serial device?
Could the serial device need different permissions?

Code: Select all

#cat /proc/version

Linux version 2.6.28-14-generic (buildd@palmer) (gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) ) #47-Ubuntu SMP Sat Jul 25 00:28:35 UTC 2009
#dmesg (after pluging in my Samsung Eternity SHG-a867 with USB Data Cable)
[ 1299.932137] usb 1-2: new high speed USB device using ehci_hcd and address 3
[ 1300.075933] usb 1-2: configuration #1 chosen from 1 choice
[ 1300.588587] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
[ 1300.590951] usbcore: registered new interface driver cdc_acm
[ 1300.590960] cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
I can now connect to internet in Linux over the phone and transfer data to and from phone. Now I want to pass the USB cable serial port off to Windows XP (up to date) under VirtualBox but I am getting errors.

First I tried to enable USB under VirtualBox but windows freezes up when it installs the USB EHCI Root Hub. So I removed the USB controllers under device manager and rebooted. Now I cant even boot into Windows if USB 2.0 is enabled under VirtualBox.

So I thought I'll just pass the serial serial port /dev/ttyACM0 to the Virtual Machine instead.

Code: Select all

#cat VBox.log (Host Pipe)
00:00:02.157 AssertLogRel /home/vbox/vbox-3.0.2/src/VBox/Devices/Serial/DevSerial.cpp(934) int serialConstruct(PDMDEVINS*, int, CFGMNODE*): <NULL>
00:00:02.157 Serial0: Failed to attach to char driver. rc=VERR_NET_CONNECTION_REFUSED
00:00:02.157 PDM: Failed to construct 'serial'/0! VERR_NET_CONNECTION_REFUSED (-461) - Connection refused.
00:00:02.165 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={0a51994b-cbc6-4686-94eb-d4e4023280e2} aComponent={Console} aText={NamedPipe#0 failed to connect to local socket /dev/ttyACM0 (VERR_NET_CONNECTION_REFUSED).
00:00:02.165 Unknown error creating VM (VERR_NET_CONNECTION_REFUSED)} aWarning=false, preserve=false
00:00:02.179 Power up failed (vrc=VERR_NET_CONNECTION_REFUSED, rc=NS_ERROR_FAILURE (0X80004005))
#cat VBox.log (Host Device)
00:00:02.221 VM: Raising runtime error 'DrvHostSerialFail' (fFlags=0x0)
00:00:02.221 Console: VM runtime error: fatal=false, errorID=DrvHostSerialFail message="Ioctl failed for s
erial host device '/dev/ttyACM0' (VERR_INVALID_PARAMETER). The device will not work properly"

VirtualBox 3.0.2 r49928
#modinfo vboxdrv
filename:       /lib/modules/2.6.28-14-generic/updates/dkms/vboxdrv.ko
version:        3.0.2 (0x000e0000)
license:        GPL
description:    VirtualBox Support Driver
author:         Sun Microsystems, Inc.
srcversion:     FB5FE144C7242148EAFEC75
depends:        
vermagic:       2.6.28-14-generic SMP mod_unload modversions 586 
parm:           force_async_tsc:force the asynchronous TSC mode (int)

<!-- Sun VirtualBox Machine Configuration -->
?
<VirtualBox version="1.7-linux">
?
<Machine uuid="{428f3118-eec8-4caa-afe5-c102b911513e}" name="Windows XP" OSType="WindowsXP" lastStateChange="2009-07-30T19:42:11Z">
?
<ExtraData>
<ExtraDataItem name="GUI/SaveMountedAtRuntime" value="yes"/>
<ExtraDataItem name="GUI/LastCloseAction" value="powerOff"/>
<ExtraDataItem name="GUI/LastWindowPostion" value="5,40,1264,749,max"/>
<ExtraDataItem name="GUI/Fullscreen" value="off"/>
<ExtraDataItem name="GUI/Seamless" value="off"/>
<ExtraDataItem name="GUI/AutoresizeGuest" value="on"/>
<ExtraDataItem name="GUI/ShowMiniToolBar" value="yes"/>
<ExtraDataItem name="GUI/MiniToolBarAutoHide" value="on"/>
</ExtraData>
?
<Hardware>
?
<CPU count="1">
<HardwareVirtEx enabled="true"/>
</CPU>
<Memory RAMSize="384"/>
?
<Boot>
<Order position="1" device="DVD"/>
<Order position="2" device="HardDisk"/>
</Boot>
<Display VRAMSize="12" monitorCount="1" accelerate3D="false"/>
<RemoteDisplay enabled="false" port="3389" authType="Null" authTimeout="5000"/>
?
<BIOS>
<ACPI enabled="false"/>
<IOAPIC enabled="false"/>
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
<BootMenu mode="MessageAndMenu"/>
<TimeOffset value="0"/>
<PXEDebug enabled="false"/>
</BIOS>
?
<DVDDrive passthrough="false">
<HostDrive src="/dev/sr0"/>
</DVDDrive>
<FloppyDrive enabled="true"/>
?
<USBController enabled="true" enabledEhci="true">
<DeviceFilter name="SAMSUNG Electronics CO.,Ltd. SAMSUNG CDMA Technologies [0001]" active="false" vendorId="04E8" productId="6601" revision="0001" manufacturer="" product="" serialNumber="" port="" remote="no"/>
</USBController>
?
<Network>
?
<Adapter slot="0" enabled="true" MACAddress="080027A7909E" cable="true" speed="0" type="Am79C973">
<NAT/>
</Adapter>
<Adapter slot="1" enabled="false" MACAddress="0800275F39DB" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="2" enabled="false" MACAddress="080027829B6C" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="3" enabled="false" MACAddress="080027C8B10C" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="4" enabled="false" MACAddress="080027FDCC25" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="5" enabled="false" MACAddress="0800279F3D91" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="6" enabled="false" MACAddress="080027AB9A00" cable="true" speed="0" type="Am79C973"/>
<Adapter slot="7" enabled="false" MACAddress="080027AD3A1F" cable="true" speed="0" type="Am79C973"/>
</Network>
?
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="HostDevice" path="/dev/ttyACM0"/>
<Port slot="1" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
</UART>
?
<LPT>
<Port slot="0" enabled="false" IOBase="0x378" IRQ="4"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="4"/>
</LPT>
<AudioAdapter controller="AC97" driver="ALSA" enabled="false"/>
?
<SharedFolders>
<SharedFolder name="vbox-share" hostPath="/home/nicholse/Desktop/vbox-share" writable="true"/>
</SharedFolders>
<Clipboard mode="Bidirectional"/>
<Guest memoryBalloonSize="0" statisticsUpdateInterval="0"/>
?
<GuestProperties>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Windows XP Professional" timestamp="1248982555828267000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="5.1.2600" timestamp="1248982555839898000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxControl.exe" value="2.2.2r46594" timestamp="1248982555898603000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxHook.dll" value="2.2.2r46594" timestamp="1248982555905434000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxDisp.dll" value="2.2.2r46594" timestamp="1248982555908530000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMRXNP.dll" value="2.2.2r46594" timestamp="1248982555913038000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxService.exe" value="2.2.2r46594" timestamp="1248982555914266000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxTray.exe" value="2.2.2r46594" timestamp="1248982555922003000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGuest.sys" value="2.2.2r46594" timestamp="1248982555924879000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMouse.sys" value="2.2.2r46594" timestamp="1248982555927842000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxSF.sys" value="2.2.2r46594" timestamp="1248982555930457000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxVideo.sys" value="2.2.2r46594" timestamp="1248982555939905000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsers" value="1" timestamp="1248982708460473000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/NoLoggedInUsers" value="false" timestamp="1248982566973221000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="3" timestamp="1248982555866821000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="1" timestamp="1248982708387205000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/IP" value="10.0.2.15" timestamp="1248982708406502000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Broadcast" value="255.255.255.255" timestamp="1248982708425925000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Netmask" value="255.255.255.0" timestamp="1248982708444936000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/Net/0/Status" value="Up" timestamp="1248982708449297000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/LoggedInUsersList" value="root" timestamp="1248982708458639000" flags=""/>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="C" timestamp="1248982779881875000" flags=""/>
</GuestProperties>
</Hardware>
?
<StorageControllers>
?
<StorageController name="IDE" type="PIIX4" PortCount="2">
?
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{964dae34-8f0d-40fe-af7a-3b14956d4a91}"/>
</AttachedDevice>
</StorageController>
</StorageControllers>
</Machine>
</VirtualBox>
MOD Edit: Please use code block for long or log files.

Re: USB / Serial Passtrough

Posted: 30. Jul 2009, 22:03
by baf
What are the results of

Code: Select all

ls -l /dev/ttyACM0
id

Re: USB / Serial Passtrough

Posted: 30. Jul 2009, 22:08
by havealoha
crw-rw-r-- 1 root dialout 166, 0 2009-07-30 13:05 /dev/ttyACM0

uid=1000(me) gid=1000(me) groups=4(adm),20(dialout),24(cdrom),46(plugdev),106(lpadmin),121(admin),122(sambashare),1000(me)

Im in dialout....

Re: USB / Serial Passtrough

Posted: 30. Jul 2009, 22:22
by havealoha
The original post about log output from (host device) was wrong, the cable may not have been plugged in... Here is the output with cable in...

00:00:02.221 VM: Raising runtime error 'DrvHostSerialFail' (fFlags=0x0)
00:00:02.221 Console: VM runtime error: fatal=false, errorID=DrvHostSerialFail message="Ioctl failed for s
erial host device '/dev/ttyACM0' (VERR_INVALID_PARAMETER). The device will not work properly"

Edited original post to reflect this too...

Re: USB / Serial Passthrough

Posted: 30. Jul 2009, 22:40
by baf
The results of ls and id looks ok.
Are you sure this is the correct device to talk with the phone? It looks to me as that is only the modem part of it.
Try removing the phone and do

Code: Select all

ls -l /dev >/tmp/file1
connect it and do

Code: Select all

ls -l /dev >/tmp/file2
cd /tmp
diff file1 file2
Post the results of that.
Oh and please put the xml and log in your first post in code blocks.

Re: USB / Serial Passthrough

Posted: 31. Jul 2009, 09:46
by havealoha
Hope this helps! I cant seem to make anything out of it.

The endpoint addresses seem to correlate with the diff'd devices for whatever thats worth.

Code: Select all

# diff file1 file2
8c8
< drwxr-xr-x  2 root   root          3760 2009-07-31 00:11 char
---
> drwxr-xr-x  2 root   root          3860 2009-07-31 00:11 char
152a153
> crw-rw-r--  1 root   dialout   166,   0 2009-07-31 00:11 ttyACM0
159a161,164
> crw-rw-r--  1 root   dialout   252,  13 2009-07-31 00:11 usbdev1.5_ep00
> crw-rw-r--  1 root   dialout   252,  12 2009-07-31 00:11 usbdev1.5_ep01
> crw-rw-r--  1 root   dialout   252,  10 2009-07-31 00:11 usbdev1.5_ep81
> crw-rw-r--  1 root   dialout   252,  11 2009-07-31 00:11 usbdev1.5_ep82

# lsusb
Bus 001 Device 005: ID 04e8:6601 Samsung Electronics Co., Ltd Z100 Mobile Phone
# lsusb -v -D /proc/bus/usb/001/005
Device: ID 04e8:6601 Samsung Electronics Co., Ltd Z100 Mobile Phone
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x04e8 Samsung Electronics Co., Ltd
  idProduct          0x6601 Z100 Mobile Phone
  bcdDevice            0.01
  iManufacturer           2 SAMSUNG Electronics CO.,Ltd.
  iProduct                1 SAMSUNG CDMA Technologies
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           75
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       0 
      bFunctionProtocol       0 
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0 
      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Re: USB / Serial Passthrough

Posted: 31. Jul 2009, 10:52
by havealoha
I tried a tether between linux and the phone using bluetooth instead of USB. When I added that new serial device as a hosted device port to VirtualBox, COM1 /dev/rfcomm0, I get the same ioctrl errors as with the USB cable.