D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Problem in use of VirtualBox to demonstrate a server based software locally on my machine

 

Done programmatically rather than messing with nasty GUIs:

Find out what the VM's name is and which network adapter you are using 
on the host PC to talk to the internet. In my case I'll use "zfsbot" as 
my VM and my host workstation's main network adapter is "enp6s0". Make 
sure the VM is not running when you run these commands! Set up your 
variables:

export vmname=zfsbot

export hostphy=enp6s0

echo $vmname $hostphy


Set yours appropriately obviously. To apply:

# check current settings:

VBoxManage showvminfo $vmname | grep "NIC 1"

# change the VM's adapter settings:

VBoxManage modifyvm $vmname --nic1 bridged

VBoxManage modifyvm $vmname --bridgeadapter1 $hostphy

# boot the VM

VBoxManage startvm $vmname


If you want to set the network type back at any point then:

VBoxManage modifyvm $vmname --nic1 nat


It's always easier and more consistent to deal with complex tools via 
reproducible shell commands than clicking around in unfamiliar GUIs.

Cheers


-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq