How to Install Debian in a Virtual Machine?

From LHYcloud Docs
Jump to navigation Jump to search

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)

D1.webp

Step:3) Choose Your preferred Language, Location and Keyboard Layout

In this step you will be asked to choose your preferred language.

D2.webp

Click on Continue

Select your preferred location, based on location, time zone will be automatically set for your system.

D3.webp

Now Choose your keyboard layout that suits to your installation,

D4.webp

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”

D5.webp


Specify the domain name that suits to environment and installation and then click on Continue

D6.webp

Step:5) Specify the root user’s password

Specify the root password in the screen below and then click on Continue

D7.webp

Step:6) Create Local User and its password

D8.webp

Click on Continue

D9.webp

Click on Continue and specify the password in the next window

D10.webp

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)
D11.webp

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.

D13.webp

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.

D14.webp

In the next screen, partition table will be displayed, cross verify the partitions size, file system type and mount point.

D15.webp

Click on Continue to proceed further,

In the next screen, choose “yes” to write changes to disk,

D16.webp

Click on Continue to proceed with installation,

Step:8) Debian 10 Installation Started

D17.webp

During the installation, installer will prompt you to scan CD/DVD for configuring package manager, Choose No and then click on Continue

D18.webp

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

D19.webp

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

D20.webp

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

D21.webp

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

D22.webp

Click on Continue to proceed with Installation,

Choose the option “yes” to install Grub Boot Loader

D23.webp

Click on Continue to proceed with installation, Once the installation is completed then installer will prompt us to reboot the system,

D24.webp

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.