Page 1 of 2

Can't obtain IP from DHCP on Ubuntu Desktop in bridged mode

Posted: 13. May 2013, 23:31
by leonger
Hello! I've just installed Ubuntu desktop 13.04 on a VM, but cannot get a network connection in bridged mode. It works fine with NAT, but I need to access this VM from other machines, so I am trying to make the bridged connection work. Here is what I get when running ifconfig:

Code: Select all

eth1      Link encap:Ethernet  HWaddr 08:00:27:ea:1f:42  
          inet6 addr: fe80::a00:27ff:feea:1f42/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:79 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:22751 (22.7 KB)  TX bytes:17272 (17.2 KB)

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:47 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4642 (4.6 KB)  TX bytes:4642 (4.6 KB)
I've seen a number of posts on this issue and tried the recommended solutions such as assigning a new MAC to this box and removing /etc/udev/rules.d/70-persistent-net.rules files, all to no avail.
Anyone can suggest anything else?
Thanks in advance!

Re: Can't obtain IP from on Ubuntu Desktop in bridged mode

Posted: 13. May 2013, 23:35
by noteirak
What is the output of :

Code: Select all

sudo cat /etc/network/interfaces

Re: Can't obtain IP from on Ubuntu Desktop in bridged mode

Posted: 14. May 2013, 15:41
by leonger

Code: Select all

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

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 15:53
by noteirak
Seems like a guest config issue, but I never use Ubuntu in desktop mode so I am not 100% sure this is used. Regardless, make sure your network config is right and that every firewall is disabled, both software & hardware on every machine (guest & host).

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 16:21
by Perryg
I would be interested in seeing the ifconfig -a results as well as:

From the hosts terminal/command window type VBoxManage showvminfo <VM Name> --details and post here. Replace <VM Name> with the actual name of the VM. Use " " if the name has a space in it.

Note if the host is Windows you need to be in the directory that has VBoxManage.exe for the command to work.

Finally VBoxManage list bridgedifs from the hosts terminal

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 16:53
by leonger
Thanks for looking into it, guys!

Ifconfig output from the guest is in the original post.

Here is showvminfo output from Win-7 host:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage showvminfo Pugliese --details
Name:            Pugliese
Groups:          /
Guest OS:        Ubuntu
UUID:            8b7667af-906e-4652-8133-4a0cc0b631c4
Config file:     C:%HOMEPATH%\VirtualBox VMs\Pugliese\Pugliese.vbox
Snapshot folder: C:%HOMEPATH%\VirtualBox VMs\Pugliese\Snapshots
Log folder:      C:%HOMEPATH%\VirtualBox VMs\Pugliese\Logs
Hardware UUID:   8b7667af-906e-4652-8133-4a0cc0b631c4
Memory size:     2048MB
Page Fusion:     off
VRAM size:       128MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
Synthetic Cpu:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          off
PAE:             on
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Hardw. virt.ext exclusive: off
Nested Paging:   on
Large Pages:     on
VT-x VPID:       on
State:           running (since 2013-05-14T13:21:00.031000000)
Monitor count:   1
3D Acceleration: on
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (0, 0): C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso (UUID: 3e65031a-21c8-48e5-a087-38fc338549c3)
SATA (0, 0): C:%HOMEPATH%\VirtualBox VMs\Pugliese\Canaro.vdi (UUID: 61e1b1a3-e188-4461-bf27-b2f5d7efba00)
NIC 1:           MAC: 080027EA1F42, Attachment: Bridged Interface 'Intel(R) Cent
rino(R) Ultimate-N 6300 AGN', Cable connected: on, Trace: off (file: none), Type
: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-vms,
Bandwidth group: none
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: DSOUND, Controller: AC97)
Clipboard Mode:  Bidirectional
Drag'n'drop Mode:  Bidirectional
Video mode:      1207x686x32
VRDE:            disabled
USB:             enabled
EHCI:            disabled

USB Device Filters:

Index:            0
Active:           yes
Name:             hp v165w [1000]
VendorId:         03f0
ProductId:        5307
Revision:         1000
Manufacturer:     hp
Product:          v165w
Remote:           0
Serial Number:    002215DF2DC2AC60C2CF0044

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Description:
Ubuntu 32 bit Desktop
Guest:

Configured memory balloon size:      0 MB
OS type:                             Linux26_64
Additions run level:                 2
Additions version:                   4.2.12 r84980


Guest Facilities:

Facility "VirtualBox Base Driver": active/running (last update: 2013/05/13 21:16:05 UTC)
Facility "VirtualBox System Service": active/running (last update: 2013/05/13 21:16:08 UTC)
Facility "Seamless Mode": active/running (last update: 2013/05/13 21:16:09 UTC)
Facility "Graphics Mode": active/running (last update: 2013/05/13 21:16:09 UTC)
And here is bridgedifs:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage list bridgedifs
Name:            Intel(R) 82579LM Gigabit Network Connection
GUID:            7d8595fc-3e35-457d-9166-489903a70add
DHCP:            Enabled
IPAddress:       10.68.222.97
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:506a:2e03:42b1:5833
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: d0:67:e5:44:1b:db
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-Intel(R) 82579LM Gigabit Network Connection

Name:            Intel(R) Centrino(R) Ultimate-N 6300 AGN
GUID:            58ab4579-eec8-4f6a-9d47-454f091109e1
DHCP:            Enabled
IPAddress:       10.68.43.108
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:e4bf:d3e0:9611:e80c
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 24:77:03:38:c5:fc
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-Intel(R) Centrino(R) Ultimate-N 6300 AGN

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 16:58
by leonger
And BTW, 2 Ubuntu server VMs on the same host work just fine under bridged connection, so I suspect this is something with guest setup for the desktop...

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 17:04
by Perryg
Ifconfig output from the guest is in the original post.

But I asked for ifconfig -a are you saying that it is the same?

post the file /etc/udev/rules.d/70-persistent-net.rules

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 20:00
by leonger
Yep, the same thing:

Code: Select all

~$ ifconfig -a
eth1      Link encap:Ethernet  HWaddr 08:00:27:ea:1f:42  
          inet6 addr: fe80::a00:27ff:feea:1f42/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:446 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:44427 (44.4 KB)  TX bytes:12420 (12.4 KB)

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:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3136 (3.1 KB)  TX bytes:3136 (3.1 KB)
/etc/udev/rules.d/70-persistent-net.rules:

Code: Select all

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:52:c4:9c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:ea:1f:42", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 20:13
by Perryg

Code: Select all

NIC 1:           MAC: 080027EA1F42, Attachment: Bridged Interface 'Intel(R) Centrino(R) Ultimate-N 6300 AGN', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-vms, Bandwidth group: none
NIC 2:           disabled

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:52:c4:9c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:ea:1f:42", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
You can see your issue above. You have two assigned adapters and only one active. In this scenario the guest is going to expect to use eht0 and it is not attached to the working connection.

All you should need to do is completely delete /etc/udev/rules.d/70-persistent-net.rules and reboot the guest. It should then detect the right MAC address and assign it to eth0.

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 20:53
by leonger
Did that - no success.
Removed the file again, shut down guest, refreshed MAC address, started guest - no success either :(

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 20:55
by Perryg
Does it still say eth1?

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 21:59
by leonger
no, it says eth0:

Code: Select all

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:8f:fd:4d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 22:06
by Perryg
Ok so now post the results of ifconfig -a
And cat /etc/network/interfaces

Re: Can't obtain IP from DHCP on Ubuntu Desktop in bridged m

Posted: 14. May 2013, 23:01
by leonger
Here you go:

Code: Select all

leonger@pugliese:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 08:00:27:8f:fd:4d  
          inet6 addr: fe80::a00:27ff:fe8f:fd4d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28858 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1863 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3109000 (3.1 MB)  TX bytes:407604 (407.6 KB)

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:1048 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1048 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:85808 (85.8 KB)  TX bytes:85808 (85.8 KB)

leonger@pugliese:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback