6. 5. Now start the VM. We want to change the
host name permanently to ‘blue’.
• To do this we need to edit the ‘HOSTNAME’ file in the /etc/ directory
as the root user.
• Execute ‘cd /etc/’ to get to the /etc/ directory.
• Next execute ‘vim HOSTNAME’
• Our file will appear as so :
7. 6. Now we edit the file to change the ‘red’ to
‘blue’
• Type in ‘:e’ to edit the file.
• Ensure you are in ‘insert’ mode ( click on the insert button ) you
should see “– INSERT –” bolded in the bottom left corner.
• Edit ‘red.lab.ubnetdef’ to ‘blue.lab.ubnetdef’
• Once edited, escape out of insert mode ( hit escape 3 times ) and
then enter in ‘:wq’ to save the file once done
8. 7. Reboot the system by executing ‘reboot’
• Once rebooted you can execute the command ‘hostname’ and it
should print ‘blue’. You have successfully cloned and changed the
hostname of a machine!