During my work, I had to set up an Ubuntu 7 VM on VMWare, and copy some files out of it. Ubuntu 7 is a very old system, and some VMWare features did not work out-of-the-box.
I spent a lot of time figuring out how to transfer files between the host and the VM, so I decided to write it down here.
Here are some things I tried but did not work:
- Shared folders: VMWare Tools for Ubuntu 7 did not work, and it was too much trouble to install it from source
- Bridged network: The VM was not able to get an IP address from the host machine
- NAT network: Same as above
Finally, I set up a host-only network, which worked well. Here are the steps I took:
Step 1: Confirm network interface on host machine
Identify network interface “VMnet1” on host machine, which is the default host-only network interface for VMWare.
|
|
Step 2: Configure network adapter
In order to connect to VMnet1
from inside the VM, we need to add a network adapter.
Go to VM settings, and add a network adapter:
The pre-defiend “Host-only” option did not work for me, so I chose “Custom” and selected “VMnet1” from the dropdown.
After configuring that, confirm it inside the VM:
|
|
You should see a new network interface, like eth1
or ens33
. In my case, it was eth1
.
Step 3: In VM, edit /etc/network/interfaces
Make sure to remove the original network interfaces, and configure the newly added one like this:
|
|
Make sure the subnet mask matches VMnet1, and the IP is in the subnet
Step 4: Restart VM networks
Restart the network service to apply the changes.
Since Ubuntu 7 uses ifupdown
, the command is:
|
|