could not connect to usb-ethernet adapter in Ubuntu in VM

Discussions about using Linux guests in VirtualBox.
Post Reply
engg_sajjad
Posts: 3
Joined: 4. Oct 2018, 16:56

could not connect to usb-ethernet adapter in Ubuntu in VM

Post by engg_sajjad »

Hi,
I m using Virtual Box on Windows 7. And in VirtualBox I m using a Ubuntu14.04 guest. I want to connect my Ubuntu guest to two networks:
1. Internet through "eth0"
2. A Qualcomm board running Andriod guests through "eth2" ( want to connect my Ubuntu to these using DHCP)

My Ubuntu VM settings are:
Network > Adapter 1 > NAT (Enable Network Adapter)
USB > Enable USB COntroller > USB 3.0 (XHCI) Controller > USB Device Filters: Moschip Semiconductor USB-MAC Controller

ifconfig output is:

Code: Select all

eth0      Link encap:Ethernet  HWaddr 08:00:27:f1:1a:08  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fef1:1a08/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5659 (5.6 KB)  TX bytes:4560 (4.5 KB)

eth2      Link encap:Ethernet  HWaddr 00:13:3b:62:17:89  
          inet addr:192.168.10.5  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:84 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:7408 (7.4 KB)  TX bytes:7408 (7.4 KB)
/etc/network/interfaces contains:

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

auto eth2
#allow-hotplug eth1
iface eth2 inet static
address 192.168.10.5
netmask 255.255.255.0
#dns-nameservers 8.8.8.8 8.8.4.4
gateway 192.168.10.1
/etc/dhcp/dhcpd.conf is appended at the end with the following:

Code: Select all

subnet 192.168.10.0 netmask 255.255.255.0 {
option routers                  192.168.10.5;
option subnet-mask              255.255.255.0;
option domain-search            "tecmint.lan";
option domain-name-servers      192.168.10.5;
range   192.168.10.10   192.168.10.10;
range   192.168.10.11   192.168.10.11;}
host server {
#hardware ethernet 00:0a:cd:2c:ee:0a;
hardware ethernet 00:13:3b:62:17:89;
fixed-address 192.168.10.5;}
/etc/default/isc-dhcp-server contains:

Code: Select all

INTERFACES="<Name of the device>"
but when I try to connect to Andriod using telnet 192.168.10.10, it is not being connected. Also, I cant see/connect to "eth2" through the network manager. While I can connect to eth0.

Please help me out. I m new to this topic. Sorry if this question is asked already.
Regards
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: could not connect to usb-ethernet adapter in Ubuntu in VM

Post by socratis »

engg_sajjad wrote:2. A Qualcomm board running Andriod guests through "eth2" ( want to connect my Ubuntu to these using DHCP)
Using DHCP? Is there a DHCP server running? Where? In the Android guest? On the Qualcomm board?
engg_sajjad wrote:
auto eth2
#allow-hotplug eth1
iface eth2 inet static
address 192.168.10.5
netmask 255.255.255.0
Isn't that conflicting information? Declaring it both as 'auto' and then as 'static'? And what about that "using DHCP" part?
engg_sajjad wrote:Also, I cant see/connect to "eth2" through the network manager.
Methinks that you've messed up the network configuration on your guest. Did you actually have to manually edit those files by hand?
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.
engg_sajjad
Posts: 3
Joined: 4. Oct 2018, 16:56

Re: could not connect to usb-ethernet adapter in Ubuntu in VM

Post by engg_sajjad »

Hi socratis,
I want to configure a new DHCP manually on my Ubuntu VM. Currently there is not DHCP.
I have manually configured these files.
Regards
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: could not connect to usb-ethernet adapter in Ubuntu in VM

Post by socratis »

engg_sajjad wrote:I want to configure a new DHCP manually on my Ubuntu VM. Currently there is not DHCP.
So you want your Ubuntu to act as a DHCP server and the Qualcomm board to get an IP from Ubuntu? Is that what you want to do?
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.
engg_sajjad
Posts: 3
Joined: 4. Oct 2018, 16:56

Re: could not connect to usb-ethernet adapter in Ubuntu in VM

Post by engg_sajjad »

Yes, You are right. Thanks for the response.
Last edited by socratis on 6. Oct 2018, 17:00, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: could not connect to usb-ethernet adapter in Ubuntu in VM

Post by socratis »

engg_sajjad wrote:I have manually configured these files.
Well, sorry to say it, but it doesn't look like you've done it correctly. As I said, you can't have a NIC being both 'static' and 'auto' at the same time! Why don't you use a GUI/CLI tool to properly configure your 'eth2' card?

And BTW, once you have captured the USB device in your guest, then it is completely NOT a VirtualBox problem. VirtualBox networking isn't involved after that. It's a matter of configuring "a computer" (Ubuntu VM) to have a DHCP server on a particular interface, and connecting "a second computer" (Qualcomm board) into that interface. VirtualBox is not involved at all...
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.
Post Reply