Move Ubuntu (VM) to Another Host

On Virtual Box is a great software of Virtualization (free and support many guest).  If you want to move a virtual machine under Virtual Box to another host, you can do it by the easy way :

Choose your virtual machine to export and location to save file, and wait until it finish 🙂

An another host you can add the virtual machie as the same way too :

Locate your location of virtual machine (“ovf” file is information about your virtual machine), wait until it finish

You done!  Start a virtual machine

The mostly problem I found are the network card or network interface can’t start up if you try to start it you will see this message

# ifconfig eth0 up
eth0: ERROR while getting interface flags: no such device

# ifconfig eth1 up
eth1: ERROR while getting interface flags: no such device

Damn what wrong?

OK  let’s solve it.

The first thing you must to do is check the ethernet card driver of your virtual machine

# lspci | grep “Ethernet”

[code lang=”text” gutter=”false”]
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
00:08.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 40)
00:09.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 40)
00:0a.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 40)
[/code]
Yes we have the driver, what wrong?

Let’s check this file, it generated from net-persistent you can modify 🙂

# nano /etc/udev/rules.d/70-persistent-net.rules

[code lang=”text” gutter=”false”]
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:d6:14:a1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:56:5d:af", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[/code]

I recommended you to remember of ATTR{address}==”xx:xx:xx:xx:xx:xx”, jot it and shut down your virtual machine.  Go to settings of this virtual machine, focus on Network

Look at this!  It’s not match with a “70-persistent-net.rules” file.  OK change em up!

If you done, start the virtual machine again
config your network address

# nano /etc/network/interface

[code lang=”text” gutter=”false”]
auto eth0
inet eth0 inet static
address YOURADDRESS
netmask YOURNETMASK
[/code]

save and restart the network

# /etc/init.d/networing restart

check the eth0 interface

# ifconfig et0

It could show the information which you config above. And you can work with your virtual machine again

ball Written by:

Teerapat Khunpech Live, Tech, Beers, Bike, Cafe Racer, Docker, Devops, Eco-System