How to Install Debian in a Virtual Machine?
Installing Debian in a virtual machine (VM) is an excellent way to test the operating system, explore its features, or create a dedicated development or server environment without affecting your primary system. Debian is one of the most stable and secure Linux distributions, making it a popular choice for both new users and experienced professionals.
Why Install Debian in a Virtual Machine?
Before jumping into the installation, let’s understand why you might want to install Debian in a virtual machine:
- Safe Testing Environment: You can try out Debian without altering your current OS.
- Development and Testing: Ideal for developers who need isolated environments.
- Learning Linux: Beginners can explore Debian without needing a second PC.
- Server Simulation: Set up a LAMP/LEMP stack, DNS server, or any other Linux-based services.
Prerequisites
1. Host Machine
You’ll need a reasonably powerful computer with at least:
- 4 GB RAM (8 GB or more recommended)
- 20 GB of free disk space
- A processor that supports virtualization (Intel VT-x or AMD-V)
2. VirtualBox (or any hypervisor)
VirtualBox is a free, open-source virtualization tool available for Windows, macOS, and Linux. Download and install it from https://www.virtualbox.org./
3. Debian ISO Image
Download the official Debian ISO image from https://www.debian.org/distrib/. Choose the appropriate architecture (typically amd64 for 64-bit systems) and opt for the netinst or DVD ISO, depending on your preference.
Step-by-Step Installation Guide
Step:1) Download Debian 10 ISO file
Download the Debian 10 ISO file from its official portal,
https://www.debian.org/distrib/
Once the ISO file is downloaded, burn it either into USB or DVD and make it bootable.
Step:2) Boot Your System with Installation Bootable Media (USB / DVD)
Step:3) Choose Your preferred Language, Location and Keyboard Layout
In this step you will be asked to choose your preferred language.
Click on Continue
Select your preferred location, based on location, time zone will be automatically set for your system.
Now Choose your keyboard layout that suits to your installation,
Click on Continue to proceed further,
Step:4) Set Host name and Domain Name for Debian 10 System
Set the hostname that suits to your environment and then click on Continue, in my case I am specifying the hostname as “debian10-buster”
Specify the domain name that suits to environment and installation and then click on Continue
Step:5) Specify the root user’s password
Specify the root password in the screen below and then click on Continue
Step:6) Create Local User and its password
Click on Continue
Click on Continue and specify the password in the next window
Step:7) Choose Hard Disk Partitioning Scheme for Debian 10
- Guided Partitioning (Installer will automatically create required partitions)
- Manual Partitioning (As name suggests using this we can create manual partitions scheme)
In the next screen, you will be asked to choose partitions, if are a new Linux user then choose the first option and in case you want a separate home partition then choose second option and else third option, which will create a separate partition for /home, /var and /tmp.
In the next screen, you will be asked to choose partitions, if are a new Linux user then choose the first option and in case you want a separate home partition then choose second option and else third option, which will create a separate partition for /home, /var and /tmp.
In the next screen, partition table will be displayed, cross verify the partitions size, file system type and mount point.
Click on Continue to proceed further,
In the next screen, choose “yes” to write changes to disk,
Click on Continue to proceed with installation,
Step:8) Debian 10 Installation Started
During the installation, installer will prompt you to scan CD/DVD for configuring package manager, Choose No and then click on Continue
In the next screen choose “yes” if you want to configure Package Manager based on Network but for this to work, make sure your system is connected to Internet, else Choose No
Click on continue to configure package manager based on your location, In next couple of screens you will be prompted to choose location and Debian package repository URL, then you will get below screen
Click on continue to configure package manager based on your location, In next couple of screens you will be prompted to choose location and Debian package repository URL, then you will get below screen
In the next window, you will be prompted to choose Desktop environment and other packages, in my case I am selecting Gnome Desktop, SSH Server and Standard System utilities
Click on Continue to proceed with Installation,
Choose the option “yes” to install Grub Boot Loader
Click on Continue to proceed with installation, Once the installation is completed then installer will prompt us to reboot the system,
Click on Continue to reboot your system and don’t forget to change boot medium from Bios settings so that system boots up with hard disk on which we have installed Debian 10 OS.