The trouble with VM customization and Ubuntu 18 on VMware Vsphere 6.5u2+
So I spent about a day figuring out all of the dilemmas with Ubuntu recently. I’m putting my notes down here because I found the various pieces I needed from different sources.
Here goes.
Part 1 – Dealing with the hostname customization and Nic disconnect issue
# First Deploy Ubuntu 18.04 from iso on new VM
# Second take your updates
sudo apt-get update && sudo apt-get upgrade
#Cloud-init is installed by default
#Third Follow KB https://kb.vmware.com/s/article/56409
But use "After=dbus.socket" instead of "After=dbus.service"
Steps are below in case the KB article gets mangled through time.
Open the?tmp.conf?under?/usr/lib/tmpfiles.d/tmp.conf?file.
Go to the line 11 and add the prefix # .
For example
#D?/tmp 1777 root root -
If you have open-vm-tools installed, open the /lib/systemd/system/open-vm-tools.service file.
Add this line ?After=dbus.socket? under [Unit]
#Fourth Step Clean up cloud-init
sudo cloud-init clean --log
Part 2 – Fixing the New IP address issue ( Found the fix here)
https://superuser.com/questions/1338510/wrong-ip-address-from-dhcp-client-on-ubuntu-18-04
The cause of the problem is that the built-in network config of Ubuntu 18.04 no longer uses the NIC Mac address as the default id for DHCP requests.
The traditional (and I believe “sensible”) behavior can be restored by adding dhcp-identifier: mac
to the configuration in the /etc/netplan/xxx.yaml (cloud-init) file as follows:
network:
renderer: networkd
version: 2
ethernets:
nicdevicename:
dhcp4: true
dhcp-identifier: mac
Where “nicdevicename” is the name of your network device
Use
sudo netplan apply
Ben Tuma
Over 20 years of experience in the Information Technology field. I love technology and seeing how it changes and impacts peoples lives for the better. I have healthy appetite for innovation and problem solving.
I am sharing my knowledge and challenges in hopes to help others as we constantly face ever changes problems in IT and technology.