VMWare Ubuntu/Build The VM Image

From DDCIDeos
Jump to navigationJump to search

The following are the steps needed to create the Virtual Box Ubuntu image described in VMWare_Ubuntu. These steps are intended for IT personnel, not for end users.

Subject to change. I will update these as I make changes. Please email if you have suggestions mailto:klew@ddci.com

This procedure is typically only needed when a new mirror of the Ubuntu packages is created, e.g., every two years or so. It is typically carried out by the maintainer of the ESX VMware Server.

Features Required of the VM

Task Priority Assignee Status How to Test Remarks
Rapid response to new machine requests 9 Kevin In Work
Efficient RDP and VNC 9 Kevin In Work Connect from remove machine The related content of ddci-vm-fixup should be automatic.
Easy access to Windows file shares 9 Kevin In Work Via Nautilus (aka Files) The related (samba) content of ddci-vm-fixup should be automatic/removed.
Easy access to VM files from Windows clients 7 TBD Not Started Use windows explorer to access VM's file shares. Not yet implemented.
Easy access to Linux file shares 5 TBD Not Started Via Nautilus (aka Files)
Any user can login 7 TBD Not Started Parly works already. Active directory content for Linux users is inconsistent.
Don't have to have separate password per VM 9 TBD Not Started Parly works already. Active directory content for Linux users is inconsistent.
Docker without sudo 9 TBD Not Started docker image ls Not sure if this can be done via active directory or needs per VM configuration of some sort. Note that on a new system (bill's Linux box 10.0.3.21) user alarson can run docker without sudo, but user gkindorf can not. This makes be believe it is an active directory configuration setting.
VM can ping farm targets 8 TBD Not Started
Subversion installed 9 TBD Not Started svn help Believe this is already done.
Users have sudo access 9 TBD Not Started sudo pwd Current active directory setup is inconsistent for this.
Users can snapshot VM state 3 TBD Not Started
Support VMs based on DDCI snapshot of Ubuntu distribution 6 TBD Not Started This is currently necessary to support OpenArbor development and testing.
Support VMs based on Ubuntu latest LTS release 6 TBD Not Started For general development staff.

Other issues:

  1. Do we need backup on the VM or laptop/workstation?
  2. Do we need anti virus?

Issues with the build procedure

  1. On page VMWare_Server_Ubuntu:
    1. The color management issue noted is a bug. Please fix. Users should not see this dialog. The "Build the VM Image" instructions, if followed, I believe will remove it.
    2. The samba issue also needs to be removed. the "ddci-vm-fixup" script was created prior to adding support for active directory, and needs to be updated. The script currently sets up samba with local passwords. Samba should be configured to use the passwords from active directory.
    3. The ddci-vm-fixup script also messes with display resolutions. It would be nice to figure out how to make that automatic as well. The first login to a new VM is very very slow if the user is remote and has a large desktop, e.g., a 4k screen. It makes for a terrible first impression.
  2. After the VM was deployed there were numerous problems:
    1. Duplicate IP addresses
    2. Users were not in the docker group so it was not possible to use "sudo less" docker commands.
    3. Installing the OA test plugin resulted in an error about a missing sound card.
      ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
      Updated the OA Test Harness to create a dummy sound card. See DDCI_PCR:4547
    4. Installing VNC worked ok, but the user interface was difficult to use, and the ability to consistently connect using VNC seemed to be an issue.
    5. Pinging targets from the vms is currently not working. We get an error that the target host is unreachable. Currently, we have to manually reset the target, which is a pain.
    6. Setting up the needed mount points for the OA Test Harness (and future OA development work) was a struggle, but is working ok now. See OpenArbor_Test_Machine_Setup#Linux.2FUbuntu
    7. The OA Test Harness (and OA development) environment need a partial desk environment installed on the vm. This was a struggle, but seems to be working now. See OpenArbor_Test_Machine_Setup#Linux.2FUbuntu

Upload an ISO

This step is only needed the first time after a new Ubuntu distribution is downloaded, e.g., when upgrading from Ubuntu 20.04 to 22.04. The steps for upgrading, i.e., for acquiring a new Ubuntu distribution are at https://ddci.zapto.org/scm/Deos/maintainer-tools/docker/ubuntu-support/README.html

The desktop ISO image for the distribution needs to be uploaded the vsphere datastore. The source images are located in the distribution's "iso" directory on the redhat5 ftp server. The instructions below have an example. The location for other distributions is similar.

This guide can be used for basic vCenter setuo for a Virtual Machine. Please still follow steps here. 
For reference only https://graspingtech.com/vcenter-create-ubuntu-vm/
  1. Login as an administrator to https://vsphere.ddci.com
  2. Select the vertical disk like icon (third from left in left pane toolbar)
  3. open datastore01
  4. select "Files" in right hand pane toolbar
  5. select ISOs in the middle pane, then choose Upload Files from the right hand pane toolbar

Create a virtual machine

  1. On https://vsphere.ddci.com to create a VM, select the datacenter, e.g., esx-host1.ddci.com, or esx-host2.ddci.com and then choose a datastore to install to. Currently, the fastest is on host2 datastore-SSD. # (TBD when we get more space, where these VMs will live/What resource pool they'll be suing.
  2. ACTIONS, New Virtual Machine, Create a new virtual machine:
    • name: docker-ubuntu-20.04
    • 2 cores
    • 8-16 GB RAM 200GB for basic image, and 512GB HDD for OA Test machines. *Should you need to moifgy the space please below. Expanding the / drive on Ubuntu 20.04.x*
    • Connect the CD to a ISO Datastore: This can be done by using the ISO datastore and choosing ISOs and selecting the proper ISO for your install.
      1. Ensure VM is powered off
      2. select the host, Actions "Edit"
      3. CD/DVD drive 1, select "Datastore ISO File",
      4. in the sub-item choose the ISO from the datastore01 ISOs directory, e.g., /ISOs/ubuntu-20.04.1-desktop-amd64.iso
        • Use the desktop version, not the server
      5. check the checkbox: Connect At Power On
    • Right click on the VM and power it on.
    • Click Web Console or Remote and when the install GUI comes up, follow the below steps hitting F4, choosing OEM install, then install Ubuntu.

Install Ubuntu

  1. In righthand pane toolbar, click Start. Be ready! The next few steps happen very quickly!
  2. Click Cancel on the "Select startup disk" popup dialog.
  3. As soon as the VirtualBox boot dialog appears, press F4.
  4. As soon as the Ubuntu screen appears, hit F4 again.
  5. Press Enter for English.
  6. Arrow down to "Install Ubuntu".
  7. Press F4 again and select "OEM install (for manufacturers)". (ref https://help.ubuntu.com/community/Ubuntu_OEM_Installer_Overview) Press Enter.
  8. Press Enter again.
  9. When the installer asks for the "Unique name for this batch of systems", enter docker-ubuntu-20.04
  10. Select language.
  11. Click Continue.
  12. Keyboard Layout: Pick your preference.
  13. Click Continue.
  14. In "Updates and other software" screen, choose "Minimal installation", uncheck "Download updates while installing Ubuntu", and uncheck "Install third party software for graphics and Wi-Fi hardware and additional media formats".
  15. Click Continue.
  16. In "Installation type", choose "Erase disk and install Ubuntu".
  17. Click Install Now.
  18. "Write the changes to disks?" popup dialog: Click Continue.
  19. "Where are you?" Pick a place.
  20. Click Continue.
  21. In "Who are you?" dialog, enter "ddci" for password and confirm it.
  22. Click Continue.
  23. Wait...
  24. "Installation Complete" dialog: Click Restart Now
  25. "Please remove the installation media. Then press enter:" screen: Go to Main Menu->Machine->Settings->Storage:
    • In Controller: IDE, select the "CD Icon"
      Uncheck the: Live CD/DVD checkbox.
      Choose the "CD Icon" to the far right, "Remove Disk from Virtual Drive". Change to client image and uncheck connected.
      Click OK
  26. "Please remove the installation media. Then press enter:" screen: Press Enter.
  27. Wait for the system to reboot...
  28. Open up software & updates
    1. In the Updates tab change to:
      When there are security updates: Display immediately
      When there are other updates: Display weekly
    2. If installation is permitted, it interferes with the new-ubuntu-vm.sh script execution.


Configure Ubuntu for DDCI

In the following, substitute your username. The script installs and configures components, and joins the windows active directory domain. It asks for an active directory domain administrator user and password.

sudo realm leave   # Kevin: this is only needed for the 20.04 snapshot because a domain was joined before the snapshot was made.
wget --ask-password --user=username@ddci.com https://deos.ddci.com/scm/Deos/maintainer-tools/docker/ubuntu-support/new-ubuntu-vm.sh
chmod u+x new-ubuntu-vm.sh
sudo ./new-ubuntu-vm.sh domainAdminUser

The domainAdminUser should be, e.g., aladmin

Kevin: I do not know what the rest of this section means:

Ubuntu Image changes

If you are satisfied with your image please create template, not a snapshot. To elaborate snapshots are fine if you testing and want to be able to go back, if the test fails. Otherwise keeping snapshots of any kind for any long number of time causes issues like you cannot update the template or VM, and it takes up the space of the VM x amount of snapshots and they all grow as your main VM grows. ** We do not have space for this. **

Create Template in vCenter

Preferably in the content library, so we can use versioning

  1. Shutdown the Ubuntu VM:
  2. Click Power button (upper right middle), select "Power Off/Log Out", select "Power Off...", then click Power Off.
  3. Right click the VM and choose, Clone & Create a template from the machine state/Actions and convert to template. Choose content library on the host your are targeting.

Deploy a System

This step creates a VM from a template created in the previous step

  1. Do some vsphere magic to create a new VM from the template created above.
  2. The user can connect to the new VM using either the vsphere interface or RDP and login using their windows username and password.
  3. The first time a user logs in, execute the following command from a shell:
    ddci-vm-fixup # enables samba and does some user specific config of RDP. (TBD if keeping)
  4. should you need to adjust any setting more vCPU/Memory/HDD Space or HDD's choose the check at the end of this process to edit VM settings.
  5. The machine is now ready for a user.

Resize a HDD/After a system is deployed

Step below walking through adding space to the VM and adjusting the space so it's usable.

  1. From vSphere click the VM under hosts and clusters and right click & edit settings. Adjust HDD 1 add spaced needed.
  2. Change mounted ISO to gparted ISO mount it same as above and ensure it's checked to connect.
  3. On the TOP of edit settings to VM Options change the boot to boot on next to BIOS.
  4. boot verify boot order, hit 10 and boot to gparted ISO
  5. Select /dev/sda# you'll see the space as unallocated. slide top bar to use all the space.
  6. Click green check box ensure that the steps are run, and it takes few not zipping through it.
  7. if it does just run it again.