Linux guest cloning - clones cannot get internet access

Discussions about using Linux guests in VirtualBox.

Linux guest cloning - clones cannot get internet access

Postby Mathiasdm » 9. Dec 2008, 22:15

I'm running Ubuntu 8.10 (64-bit), and have a 32-bit Ubuntu Server guest (have been using it for a while, it's running Ubuntu 8.04) using hardware virtualisation.

Now I'd like to run multiple instances of this guest on the same pc. I used 'VBoxManage clonevdi' to create new HD images, and the new guest VM's boot fine. However, they don't get any internet access!

I've tried using different virtual interfaces, but it didn't work. I noticed the internal network interface changed to eth1 of 2 (changing on reboot) instead of eth0 like the original guest. So I tried to change '/etc/network/interfaces', followed by 'sudo /etc/init.d/networking restart', but without any luck.

Sadly, I don't know what to do :(
Mathiasdm
 
Posts: 6
Joined: 20. Jun 2008, 11:06

Postby Sasquatch » 9. Dec 2008, 23:22

What did you change in /etc/network/interfaces? What if you let it be how it was, remove everything that mentions an interface from /etc/udev/rules.d/70-persistent-net.rules and reboot? Your interfaces file should only have 4 lines of configuration, two for the loopback and two for the actual interface. Should look like this:
Code: Select all   Expand viewCollapse view
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Postby Mathiasdm » 9. Dec 2008, 23:30

I have those 4 lines, I only changed eth0 to eth1.
Changing it back and restarting networking gives eth0: ERROR while getting interface flags: no such device.
Mathiasdm
 
Posts: 6
Joined: 20. Jun 2008, 11:06

Postby Sasquatch » 9. Dec 2008, 23:35

Did you change the udev rules file like I told you? It will look something like this:
Code: Select all   Expand viewCollapse view
# 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.

# PCI device 0x11ab:0x4362 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="MAC", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10de:0x0057 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="MAC", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

And you need to make it like this:
Code: Select all   Expand viewCollapse view
# 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.

Now there are no interfaces defined here. Reboot the Guest so udev will create a new one.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Postby Mathiasdm » 10. Dec 2008, 02:07

Sorry, I overlooked that.

I've removed them now, and after reboot one line was regenerated.
eth0 is now up, but there's still no connectivity.

(And thank you for your help!)
Mathiasdm
 
Posts: 6
Joined: 20. Jun 2008, 11:06

Postby Sasquatch » 10. Dec 2008, 02:19

Does the Guest have the IP of 10.0.2.15, as it should with NAT? Does your primary DNS server work on the Host? See the VirtualBox FAQ for some help getting your internet working.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Postby Mathiasdm » 10. Dec 2008, 02:44

Sasquatch wrote:Does the Guest have the IP of 10.0.2.15, as it should with NAT? Does your primary DNS server work on the Host? See the VirtualBox FAQ for some help getting your internet working.

It does not have a 10.0.2.15 IP, even though I've set the Virtualbox configuration to NAT.
The primary DNS server works on the host, and on other guests.
The Virtualbox FAQ seems to talk about not being able to access the internet from guests in general. However, I can access the internet fine from the original virtual machine, just not from the clone.
Mathiasdm
 
Posts: 6
Joined: 20. Jun 2008, 11:06

Postby Sasquatch » 10. Dec 2008, 18:40

What IP do you get in the Guest? Is there a configuration somewhere that tells the OS to use a different IP (like a static one)?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Postby Mathiasdm » 10. Dec 2008, 20:26

It doesn't have an IP (well, only an IPv6 one.

I haven't set it to have a static address at all.
Mathiasdm
 
Posts: 6
Joined: 20. Jun 2008, 11:06

Postby Sasquatch » 10. Dec 2008, 23:20

That's really strange. Run sudo dhclient eth0 from a terminal. What do you get for output? The interface is attached to NAT? Exact same settings as with the original VM?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Silly question?

Postby shmuelakam » 11. Dec 2008, 14:29

I have a silly question (because you didn't specify):

Are you running multiple clones at the same time?
If so, did you go into the Network settings (in the VB GUI) and generate a new MAC address? Using the same MAC for two VMs won't work. :shock:
shmuelakam
 
Posts: 9
Joined: 11. Sep 2008, 09:46
Location: Israel

Re: Silly question?

Postby Sasquatch » 12. Dec 2008, 00:11

shmuelakam wrote:I have a silly question (because you didn't specify):

Are you running multiple clones at the same time?
If so, did you go into the Network settings (in the VB GUI) and generate a new MAC address? Using the same MAC for two VMs won't work. :shock:
As you can see from the responses, a new interface was created, and that only happens when a new MAC is detected. A new MAC address is automatically generated when you create a VM. Cloning a VM is a bit more work than just cloning the VDI ;).
Bit silly question, but still a possible cause, were it not that was already covered.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: Silly question?

Postby shmuelakam » 12. Dec 2008, 00:47

Sasquatch wrote:As you can see from the responses, a new interface was created, and that only happens when a new MAC is detected. A new MAC address is automatically generated when you create a VM.

Well yes, but until a True Clone Feature comes along, I have been known to clone VMs "wholesale", VDI, settings and all. If you were running two VMs with the same MAC, both guest OS would still create a new interface, right? But the host would most likely be FOOBAR with regard to [at least] one of them.

Not quite as silly a question now, is it? :wink:
shmuelakam
 
Posts: 9
Joined: 11. Sep 2008, 09:46
Location: Israel

Re: Silly question?

Postby Sasquatch » 12. Dec 2008, 23:07

shmuelakam wrote:
Sasquatch wrote:As you can see from the responses, a new interface was created, and that only happens when a new MAC is detected. A new MAC address is automatically generated when you create a VM.

Well yes, but until a True Clone Feature comes along, I have been known to clone VMs "wholesale", VDI, settings and all. If you were running two VMs with the same MAC, both guest OS would still create a new interface, right? But the host would most likely be FOOBAR with regard to [at least] one of them.

Not quite as silly a question now, is it? :wink:

As I said before, the Guest assigned a new interface name. That only happens when the MAC is changed. And the TS didn't mention that.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Postby Mathiasdm » 14. Dec 2008, 14:43

Sasquatch wrote:That's really strange. Run sudo dhclient eth0 from a terminal. What do you get for output? The interface is attached to NAT? Exact same settings as with the original VM?

Yes, exactly the same settings. I can't give you the output, because I deleted the clone and decided to go with from-scratch VM's instead.
However, I'll create another clone, repeat my steps and then run that command to see the output. Might take me some time though.

shmuelakam wrote:I have a silly question (because you didn't specify):

Are you running multiple clones at the same time?
If so, did you go into the Network settings (in the VB GUI) and generate a new MAC address? Using the same MAC for two VMs won't work. :shock:


Yes, I did.
Mathiasdm
 
Posts: 6
Joined: 20. Jun 2008, 11:06

Next

Return to Linux Guests

Who is online

Users browsing this forum: Perryg and 14 guests