DevOps Blog

How to Install Ubuntu Server 22.04 on VirtualBox – A Step-by-Step Guide

Prerequisites:


Step 1: Create a New Virtual Machine

  1. Open VirtualBox and click New.
  2. Enter a name (e.g., Ubuntu Server 22.04), set Type to Linux, and Version to Ubuntu (64-bit).
  3. Click Next.

Create a new VM in VirtualBox


Step 2: Allocate Memory (RAM)

  • Assign at least 2GB (2048 MB) for smooth performance.
  • Click Next.

Step 3: Create a Virtual Hard Disk

  1. Select Create a virtual hard disk now and click Create.
  2. Choose VDI (VirtualBox Disk Image).
  3. Select Dynamically allocated (saves space).
  4. Set disk size to at least 10GB (25GB recommended for flexibility).
  5. Click Create.

Step 4: Attach the Ubuntu Server ISO

  1. Select your VM and click Settings.
  2. Go to Storage > Empty under the optical drive.
  3. Click the CD icon and select Choose a disk file.
  4. Browse and select the Ubuntu Server 22.04 ISO you downloaded.
  5. Click OK.

Step 5: Start the Virtual Machine

  1. Select your VM and click Start.
  2. The Ubuntu Server installer will boot.

Step 6: Install Ubuntu Server 22.04

1. Language & Keyboard Setup

  • Choose your preferred language and keyboard layout.

2. Network Configuration

  • The installer should detect your network automatically.
  • (Optional) Set a static IP if needed.

3. Proxy & Mirror Settings

  • Leave blank unless you’re behind a proxy.

4. Storage Setup

  • Select Use an entire disk (unless you need manual partitioning).
  • Confirm and proceed.

5. User & SSH Setup

  • Enter your name, server name, username, and password.
  • (Recommended) Enable Install OpenSSH server for remote access.

6. Install Additional Software (Optional)

  • Select any extra packages (e.g., Docker, LAMP stack).

7. Complete Installation

  • Wait for the installation to finish.
  • When prompted, remove the ISO and reboot.

Step 7: Log In & Update

  1. After reboot, log in with your credentials.
  2. Run updates:
    sudo apt update && sudo apt upgrade -y

Final Thoughts

You now have a fully functional Ubuntu Server 22.04 running in VirtualBox! From here, you can:

  • Set up a web server (Nginx/Apache).
  • Deploy Docker containers.
  • Practice Linux administration.

If you run into issues, check VirtualBox’s Guest Additions for better performance or adjust network settings (NAT/Bridged).

Let me know in the comments if you’d like a guide on setting up specific services!


Enjoy your Ubuntu Server journey!

Did this guide help you? Share it with others who might find it useful!