Setup Netorking in Ubuntu VM after Truenas Install

 

Use ip a in your Ubuntu VM, and it will probably show something like this:

u18_net1.jpeg



What ever connection you set up during the install (dhcp or static IP), it has been lost on the first boot. This happens because to boot the VM you have to remove the CDROM device, and when you remove the cdrom device the bhyve slot used by the NIC device changes. Inside the VM this changes the "predictable network interface name" from say enp0s5 to enp0s4.

You will need to re-configure the network inside the VM, for example:

u18-net2.jpeg



In this case, just edit appropriate netplan file to change the "predictable network interface name" to enp0s4 and restart the network , for example using a combo of sed & netplan apply:

u18-net3.jpeg