This README instructs in the creation of a new base VHDX for the following OS:
The instructions on this page are for normal lab tenant environments, e.g. SEA-Cust14. It is NOT for workshop base images, for workshop images use the specific workshop instructions in the DevOps TCSP repo.
Must be built on a Seattle physical server!!!
- RDP to any physical server in the Seattle Path Lab
- Open an Admin PS console, run
Build-LabBaseVHDXto create the VM Object - Once complete, in Hyper-V Manager, open a connection to VM
- Start the VM
- When prompted, press any key to boot from DVD
- Accept language defaults, click next
- Accept US keyboard default, click next
- Select "Install Windows Server", select the "I agree everything..." checkbox, click Next
- Select Datacenter (Desktop Experience) from the list and click Next
- Accept license terms, click next
- Select Drive 0 for install and click Next
- At the "Ready to Install" screen, click Install
- While waiting for windows to install, go to the ExpressRoute-lab key vault and get the Sever-Admin password for Administrator password use
- After the OS install completes, the OS must be configured, connect to the VM set admin password
- Using the admin password, log into the VM (you may have to down grade to a non-Enhanced Session on the View menu)
- On the Base VM, open an admin ISE PS session (admin Terminal, then run ISE)
- Switch to the physical server PowerShell run
Build-LabBaseVM, this will load the first part of the base VM script into the clipboard and pause. - Switch to the base VM, in the VM connection ensure "Enhanced Session" is OFF. To do this, in the Virtual Machine Connection client, click "View", and ensure the "Enhanced Session" is not enabled.
- In the Virtual Machine Connection client, click "Clipboard", "Type Clipboard Text" to paste the first half of the script into the PowerShell ISE script window.
- Return to the lab server, press Enter to copy the second part of the script to the clipboard.
- Paste in the script in the Base VM PowerShell ISE and then run the script (no save required).
- The installation of the Edge browser may prompt a patching cycle, allow this, and reboot if needed. If you have to reboot, log back in after reboot and open Admin PowerShell ISE, the script should still be there, run it again. Repeat until Edge installs.
- At the conclusion of the script, the VM will reboot.
- (Optional) add your local account and add to admin group
- Switch to the physical server PowerShell run
- Once rebooted, from the Azure Management jump box RDP to server 10.1.7.120, use the Admin password to log back into the Base VM.
- Patch OS
- Close the PowerShell ISE window if it auto-opens, don't save script if prompted.
- Patch, reboot if needed
- Repeat until no more updates
- Shutdown
- Right-click start and select "Shutdown or sign-out", then "Shut down"
- If prompted, select "Other (Planned)" for shut down reason
- Once VM is off, close Connect and/or RDP sessions with VM
- In Hyper-V Manager, navigate to the VM, wait for the VM State to become "Off".
- Right-click the VM and Delete it
- In File Explorer, copy the VHDX file (Base2025.vhdx) from the C:\Hyper-V\Virtual Hard Disks to the C:\Hyper-V\ISO\BaseVHDX folder
- Copy the VHDX to \10.17.7.7\Binaries\VMImages\BaseVHDX folder to easier dissemination to other servers (replace existing file if prompted)
- Delete the original VHDX file in C:\Hyper-V\Virtual Hard Disks
- Log on to each physical server to be used as a lab VM Host, and in an elevated PS prompt run Update-LabLibrary to pull the VHDX library (including the new VHDX) down to each server.
Must be built on a Seattle physical server!!!
-
RDP to any physical server in the Seattle Path Lab
-
Open an Admin PS console, run
Build-LabBaseVHDX -OS Ubuntu -
Start the VM
-
At the GNU GRUB screen, select: Try or Install Ubuntu Server (default option)
-
CGA Setup:
- Preferred Language: English, Enter to Continue
- Keyboard Config: English (US) / English (US), Enter to continue
- Instalation Type: Accept "Ubuntu Server", enter to continue
- Network Connections:
- arrow up to eth0, Enter to bring up menu
- arrow down to select IPv4, enter to bring up menu
- IPv4 Method: press Enter and select Manual
- Tab to Subnet: 10.1.7.0/25
- Tab to Address: 10.1.7.46
- Tab to Gateway: 10.1.7.1
- Tab to Name servers: 1.1.1.1,1.0.0.1
- Tab to save, Enter to continue
- arrow down to Done, Enter to continue
- Configure proxy: leave blank, Enter to continue
- Configure Ubuntu mirror: accept default, Enter to continue
- Installer Update: if this screen presents, select "Update to the new installer"
- Storage Configuration setup: "Use An Entire Disk" (default), tab to Done, Enter to continue
- Storage Configuration setup: Accept all defaults, Enter to continue to bring up pop-up warning
- Confirm Destructive action: arrow down to Continue, Enter to continue
- Profile Setup:
- Your name: Enter your first and last name separated by a space
- Your server's name: baseubuntu (all lower case)
- Pick a username: Your local account user name
- Choose a password: Your local account password
- Confirm password: repeat password
- tab to "Done", Enter to continue
- Ubuntu Pro: accept default "skip for now", enter to continue
- SSH Setup: Enter to check "Install OpenSSH server", tab to "Done", Enter to continue
- Featured Server Snaps: arrow to "Done" (leaving all unchecked), Enter to continue
- system installs, takes about 5 - 10 minutes
- system installs security updates, takes about 5 minutes
- When updates are done, on-screen "button" will flip to "Reboot", select and hit Enter
-
After reboot, you'll get a "remove installation media", ignore it and hit Enter
-
Close Virtual Machine Connection window
-
Open SSH session to 10.1.7.46
- At login prompt, use your local credentials
- Run:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get full-upgrade -y && sudo apt-get autoremove -y sudo apt-get install linux-virtual linux-cloud-tools-virtual linux-tools-virtual -y
- Wait for install to complete
-
Back on the physical server, open Admin PowerShell:
Copy-ToUbuntu- This will ask for your username and password
- it will then ask for your password four more times for each sudo step, I'll figure out how to avoid this in the future but it's needed for now.
-
Back in SSH:
sudo -u root sh /var/tmp/LabMod/base-update.sh
-
In Hyper-V Manager, select BaseUbuntu and "Shut Down..."
-
Then delete the VM
-
Back in PowerShell - copy the VHDX and then delete:
Copy-Item "C:\Hyper-V\Virtual Hard Disks\BaseUbuntu.vhdx" "C:\Hyper-V\ISO\BaseVHDX\BaseUbuntu.vhdx" -Force Copy-Item "C:\Hyper-V\Virtual Hard Disks\BaseUbuntu.vhdx" "\\10.17.7.7\Binaries\VMImages\BaseVHDX\BaseUbuntu.vhdx" -Force Remove-Item "C:\Hyper-V\Virtual Hard Disks\BaseUbuntu.vhdx"
-
Log on to each physical server to be used as a lab VM Host, and in an elevated PS prompt run Update-LabLibrary to pull the VHDX library (including the new VHDX) down to each server.
Ubuntu Base image is now complete and copied to the ISO dir, proceed with tenant VM creation
in admin ps:
New-LabVM 90 -OS Ubuntu