I recently acquired a new laptop, replacing my old HP Pavilion dv4 from (yikes…) 15 years ago. My new machine is currently running Windows 11 Pro, but I also wanted to get Linux on it. I am using Hyper-V, the Windows native virtual machine manager. At least to start. My thought is that some shops will use VMs, and so I wanted to become familiar with Hyper-V. I’ve used Virtual Box before and VMWare as well, but never Hyper-V.
Here are my notes from this process:
Overview
This entry documents the installation and configuration of Ubuntu Linux in a Hyper-V virtual machine on Windows 11, including resolution of package management conflicts, display configuration issues, and partition resizing operations.
Environment
- Host OS: Windows 11
- Hypervisor: Hyper-V
- Guest OS: Ubuntu Linux
- Display: 16-inch monitor, 4K resolution
Package Management and System Updates
Initial Update Challenges
Standard package update procedures initially failed due to held-back packages that prevented the completion of system updates.
Commands Attempted
The following standard maintenance commands were executed but did not resolve the held-back package issue:
sudo apt autoremove -y
sudo apt clean
sudo apt full-upgrade -y
Resolution
Held-back packages required explicit installation before the standard update process could complete successfully. After manually installing the held-back packages, the update process completed without errors.
Key Learning
Package dependencies in Ubuntu may sometimes create situations where packages are held back from automatic updates. When standard update commands fail to resolve all updates, identifying and explicitly installing held-back packages allows the update process to proceed.
Display Configuration and Enhanced Session
Problem
The Hyper-V virtual machine instance did not support Enhanced Session mode by default. This resulted in a fixed, small display resolution that could not be adjusted by maximizing the VM window, making the interface difficult to use on high-resolution displays.
Solution
Installation of xrdp (Remote Desktop Protocol server for Linux) enabled Enhanced Session support in Hyper-V.
# Installs the xrdp package.
sudo apt install xrdp
Result
After installing xrdp, Enhanced Session became available, allowing proper display scaling and resolution configuration. The VM instance could then be viewed at full screen resolution when the VM window was maximized.
Key Learning
Hyper-V Enhanced Session requires xrdp to be installed on Linux guest systems. This provides dynamic display resolution and improved integration between host and guest systems.
Partition Management and Resizing
Problem
The initial VM configuration allocated only 12 GB to the Linux partition, which proved insufficient for a functional system with updates and additional packages.
Objective
Expand the partition size without data loss or system reinstallation.
Commands Used
# View current block device configuration.
lsblk
# Grow the partition.growpart [device] [partition-number]
# Resize the filesystem to use expanded partition.resize2fs [device-partition]
# Verify the changes.df -h
Result
Successfully expanded the partition and filesystem without data loss, providing adequate storage space for the system.
Key Learning
Linux partitions can be resized dynamically using command-line tools without requiring system reinstallation or data migration. The process involves three steps: viewing current configuration, expanding the partition boundary, and resizing the filesystem to utilize the new space.
Outstanding Issues
Audio Configuration
Audio functionality has not yet been configured in the VM environment.
Video and network connectivity are working correctly.
Audio will likely require driver installation or configuration.
Context and Certification Goals
Current Certifications in Progress
- LPI Linux Essentials (Exam 010-160): Entry-level Linux certification.
- AWS Certified Cloud Practitioner (CLF-C02): Entry-level AWS certification.
Observations on Linux in Virtual Environments
While Linux distributions are often described as being as user-friendly as Windows for standard installations, virtualized environments may require additional configuration and troubleshooting. This hands-on experience with package management, display configuration, and partition management provides practical knowledge applicable to system administration tasks.
General Principles Learned
Package Management
- Standard update commands may not always resolve all package conflicts automatically.
- Held-back packages require explicit intervention.
- Understanding package dependencies is essential for maintaining Linux systems.
Virtualization
- Enhanced features in hypervisors may require specific software installations on guest systems.
- Display configuration in VMs differs from physical hardware installations.
- Testing and validation are necessary after each configuration change.
Storage Management
- Partition sizing should be carefully considered during initial setup.
- Dynamic partition resizing is possible without data loss when proper tools and procedures are used.
- Command-line tools provide precise control over storage configuration.
- Verification commands should always be used to confirm successful operations.
Problem-Solving Approach
- Document error messages and symptoms.
- Research specific error conditions.
- Apply solutions methodically.
- Verify results after each change.
- Maintain records of successful procedures for future reference.
Conclusion
This exercise provided practical experience with Linux system administration tasks including package management, display configuration, and storage management in a virtualized environment. The working Ubuntu VM will serve as a practice environment for Linux certification preparation.
