Installing Linux VM
Objective
Install a Linux distribution (Ubuntu Server / Debian) inside a virtual machine, configure basic settings, and prepare it for server use.
Tools & Technologies
VirtualBoxVMwareISOinstaller
Key Commands
vboxmanage createvm --name 'UbuntuServer'mount ISO in VM settingssystemctl set-default multi-user.targetsudo apt update && sudo apt upgrade -yArchitecture Overview
flowchart TD
A[Download ISO] --> B[Create VM\nRAM: 2GB+ Disk: 20GB+]
B --> C[Attach ISO\nas boot device]
C --> D[Boot VM\nfrom ISO]
D --> E[Run installer\nPartition disk]
E --> F[Set hostname\nCreate user]
F --> G[Install bootloader\nGRUB to disk]
G --> H[Reboot\nRemove ISO]
H --> I[Post-install\nconfiguration]
style A fill:#1a1a2e,stroke:#00d4ff,color:#e0e0e0
style I fill:#1a1a2e,stroke:#00ff88,color:#e0e0e0
Step-by-Step Process
01
Create the Virtual Machine
Open VirtualBox/VMware and create a new VM with at least 2GB RAM, 2 CPU cores, and 20GB disk.
# VirtualBox CLI alternative
vboxmanage createvm --name 'LabServer' --ostype Ubuntu_64 --register
vboxmanage modifyvm 'LabServer' --memory 2048 --cpus 2
vboxmanage createhd --filename ~/VMs/LabServer.vdi --size 20480
vboxmanage storagectl 'LabServer' --name SATA --add sata
vboxmanage storageattach 'LabServer' --storagectl SATA --port 0 --device 0 --type hdd --medium ~/VMs/LabServer.vdi
02
Run the Installer
Boot from the ISO, select language/region, partition the disk (LVM recommended), and create the initial user.
# During installation choose:
# - Language: English
# - Keyboard: your layout
# - Partitioning: Guided LVM (entire disk)
# - Hostname: labserver01
# - Username: your username
# - Software: OpenSSH Server (check this!)
03
Post-Installation Steps
Update the system, verify SSH is running, and configure the network.
sudo apt update && sudo apt upgrade -y
sudo systemctl status ssh
hostname && uname -r
ip addr show
# Disable root login over SSH
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
sudo systemctl restart ssh
04
Install Guest Additions (VirtualBox)
Guest additions improve performance and enable shared folders, clipboard, and dynamic screen resize.
sudo apt install -y dkms linux-headers-$(uname -r) build-essential
# In VirtualBox menu: Devices → Insert Guest Additions CD
sudo mount /dev/cdrom /mnt
sudo /mnt/VBoxLinuxAdditions.run
sudo reboot
Challenges & Solutions
- VM hangs on boot — check if virtualization (VT-x/AMD-V) is enabled in BIOS
- Installer fails to detect disk — check storage controller type (SATA vs NVMe)
Key Takeaways
- LVM during installation enables easy disk expansion later
- Enable SSH during install — saves time configuring it post-install