Getting unique IP addresses for Cloned guests
Getting unique IP addresses for Cloned guests
So that I can access VBox guests from my LAN, I have VBox attach guests to a bridge. This works perfectly for standalone guests, which get a usable IP from my DHCP server. The problem is that when I clone a guest - regardless of whether it's full or linked - it always comes up with the same dynamic IP that the source had. This happens even when I generate a new MAC address manually through the VBox Network Settings menu. I launch a lot of guests so I really don't want to have to create static IPs for each one - they're bound to conflict eventually.
Any ideas?
Thanks,
Any ideas?
Thanks,
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Getting unique IP addresses for Cloned guests
Just out of curiosity, why don't you do it during the clone operation? That would be the best place/time in my opinion. Anyway, standard troubleshooting instructions follow.dlanced wrote:This happens even when I generate a new MAC address manually through the VBox Network Settings menu.
Please read the following: Minimum information needed for assistance. As far as the "VBox.log.zip" goes, here's what you do:
- Start the VM. Not from a saved or suspended state. Clean start.
- Take the steps required to generate/observe the error.
- Record the error message. EXACTLY. Post a screenshot if you have to.
- Shut down the VM (if it hasn't aborted by itself). Not suspended, not paused. Shut down. If you can't shut it down by normal means, close the VM window and select "Power off".
- Right-click on the VM in the VirtualBox Manager.
- Select "Show Log..."
- Save it (just the first log, VBox.log), ZIP it and attach it in your response (see the "Upload attachment" at the bottom of the form).
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.
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.
-
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: Getting unique IP addresses for Cloned guests
This can only be pilot error.dlanced wrote:The problem is that when I clone a guest - regardless of whether it's full or linked - it always comes up with the same dynamic IP that the source had.
It isn't actually a VirtualBox question. When you use bridged mode VirtualBox isn't handing out IP addresses, your router is. The fact that you got an IP address in the correct range proves that you are communicating with the router, which is where VirtualBox's part ends. Now if the router is handing up the same IP address to multiple MACs then you should certainly contact your router maker about that... but I rather suspect that isn't happening. I consider it rather more likely that you have created multiple VMs with duplicated MACs, and whatever procedure you are using to change MACs is done after the event.
Re: Getting unique IP addresses for Cloned guests
socratis wrote:dlanced wrote:This happens even when I generate a new MAC address manually through the VBox Network Settings menu.
I actually did it during the clone operation as well.socratis wrote:Just out of curiosity, why don't you do it during the clone operation? That would be the best place/time in my opinion. Anyway, standard troubleshooting instructions follow.
Thanks! I've attached both logs and the output of VBoxManage showvminfo ubuntu16-Clone.socratis wrote:Please read the following: As far as the "VBox.log.zip" goes, here's what you do:
- Attachments
-
showvminfo-clone.txt- output of VBoxManage showvminfo ubuntu16-Clone
- (3.27 KiB) Downloaded 5 times
-
origin-vbox.log- vbox.log from the origin VM
- (83.83 KiB) Downloaded 4 times
-
clone-vbox.log- vbox.log from the clone
- (89.61 KiB) Downloaded 4 times
Re: Getting unique IP addresses for Cloned guests
I'm pretty sure you're correct: it does seem to be a problem with the MAC address not being changed but, as I mentioned in my reply to Socratis, I did tell VBox to chance the MAC curing cloning.mpack wrote:This can only be pilot error.dlanced wrote:The problem is that when I clone a guest - regardless of whether it's full or linked - it always comes up with the same dynamic IP that the source had.
It isn't actually a VirtualBox question. When you use bridged mode VirtualBox isn't handing out IP addresses, your router is. The fact that you got an IP address in the correct range proves that you are communicating with the router, which is where VirtualBox's part ends. Now if the router is handing up the same IP address to multiple MACs then you should certainly contact your router maker about that... but I rather suspect that isn't happening. I consider it rather more likely that you have created multiple VMs with duplicated MACs, and whatever procedure you are using to change MACs is done after the event.
By the way, in the "NAT Network Details" dialog, VBox offers "Supports DHCP" as an option: does that mean it will allow VMs to connect to an external DHCP server, or that VBox will create its own DHCP server? If it's the former, then that might be a better option for me than attaching to a bridge.
Thanks,
-
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: Getting unique IP addresses for Cloned guests
NAT (standard or NAT network) has its own DHCP server.
Re: Getting unique IP addresses for Cloned guests
Thanks. I guess that won't help me, then: I can't have two DHCP servers messing around with my LAN.mpack wrote:NAT (standard or NAT network) has its own DHCP server.
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Getting unique IP addresses for Cloned guests
OK, let's look at some of the information from the logs:
• Your clone is a linked clone based on the "ubuntu16-template". Correct?
• You do have different MAC addresses, indeed. Template: 08 00 27 d2 8f 40, Clone: 08 00 27 ed 72 39.
• You connect the template to the Bridged network to adapter "veth6YUG1Q", while you connect the clone to adapter "vethM4LIHI".
Now, I really don't understand the last part. First of all your adapters have ... "funky" names and second, they are ... different. They shouldn't be. Did you leave out some details from your story?
Finally, could you please post the output of 'ifconfig' from the template and this specific clone?
• Your clone is a linked clone based on the "ubuntu16-template". Correct?
• You do have different MAC addresses, indeed. Template: 08 00 27 d2 8f 40, Clone: 08 00 27 ed 72 39.
• You connect the template to the Bridged network to adapter "veth6YUG1Q", while you connect the clone to adapter "vethM4LIHI".
Now, I really don't understand the last part. First of all your adapters have ... "funky" names and second, they are ... different. They shouldn't be. Did you leave out some details from your story?
Finally, could you please post the output of 'ifconfig' from the template and this specific clone?
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.
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.
Re: Getting unique IP addresses for Cloned guests
Ah, yes. The bridge names. Those are virtual bridges created by my LXC host. They're available and easy to apply, but for some reason their names change every time I reboot.socratis wrote:OK, let's look at some of the information from the logs:
• Your clone is a linked clone based on the "ubuntu16-template". Correct?
• You do have different MAC addresses, indeed. Template: 08 00 27 d2 8f 40, Clone: 08 00 27 ed 72 39.
• You connect the template to the Bridged network to adapter "veth6YUG1Q", while you connect the clone to adapter "vethM4LIHI".
Now, I really don't understand the last part. First of all your adapters have ... "funky" names and second, they are ... different. They shouldn't be. Did you leave out some details from your story?
I've attached a file with ifconfig from both template and clone...and the LXC bridge from my host, for that matter.socratis wrote:Finally, could you please post the output of 'ifconfig' from the template and this specific clone?
Thanks!
UPDATE: the file didn't seem to attach, so here are its contents:
Code: Select all
ubuntu@ubuntu-template:~$ ifconfig
enp0s3 Link encap:Ethernet HWaddr 08:00:27:d2:8f:40
inet addr:10.0.3.166 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fed2:8f40/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:593 errors:0 dropped:0 overruns:0 frame:0
TX packets:397 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:733496 (733.4 KB) TX bytes:35626 (35.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:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
===================
[Clone:]
ubuntu@ubuntu16b:~$ ifconfig
enp0s3 Link encap:Ethernet HWaddr 08:00:27:ed:72:39
inet addr:10.0.3.166 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feed:7239/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:561 errors:0 dropped:0 overruns:0 frame:0
TX packets:394 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:730829 (730.8 KB) TX bytes:35223 (35.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:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
=================
LXC bridge interface from my host:
lxcbr0 Link encap:Ethernet HWaddr fe:43:11:63:6f:30
inet addr:10.0.3.1 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::f465:82ff:fedb:b209/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4089 errors:0 dropped:0 overruns:0 frame:0
TX packets:4354 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:286089 (286.0 KB) TX bytes:1759748 (1.7 MB)
Re: Getting unique IP addresses for Cloned guests
I've got it working now: as you suspected, it seems that the bridge I chose was the problem. When I selected eth0 and regenerated my MAC address, I got a new DHCP IP.
Thanks,
Thanks,
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Getting unique IP addresses for Cloned guests
For your benefit, and other that might read this thread, this was one of the really bad examples of how (not) to report a problem. You left out the most vital piece of information, which had me scratching my head for quite some time. No one here assumed that you were using a software bridge. That changes names between reboots! Who knows what else?dlanced wrote:Ah, yes. The bridge names.socratis wrote:Did you leave out some details from your story?
It's like calling your art-class teacher, complaining about not being able to paint these beautiful sceneries any more, because you think you've lost the feeling, but you "forget" to mention that you've lost your arms in the mean time!
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.
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.