Debian 13 Tutorial / Create a VirtualBox Lab VM and Prepare Recovery

Create a Debian 13 lab VM on a new virtual disk, then configure NAT networking and a recovery console before installing the operating system. A powered-off snapshot of this empty VM lets you restore its pre-installation settings, but it is not a backup of a running Debian server. This guide uses VirtualBox on a Windows host.

Boundaries of Host, Guest, and Virtual Disk

The host is the Windows computer running VirtualBox, and the guest is Debian installed inside the VM. The virtual disk is usually a file stored on the host, but Debian sees it as a separate disk device. Later, when initializing the disk in the Debian installer, you need to be able to distinguish which VM's virtual disk it is.

Creating a VM does not mean splitting the already used Windows disk for Debian. In this exercise, a new VDI (VirtualBox Disk Image) file is created, and no physical disk is connected directly to the guest. Connecting raw disks or reusing disks from existing VMs is not included in the scope of this exercise.

However, virtualization does not block all impacts. If you allocate a lot of memory to the VM or fill the host's storage with virtual disks and snapshots, it can also cause problems on the host. Shared folders, clipboard, and drag-and-drop functions also serve as connection paths between host and guest, so they are not used until there is a necessary reason.

Prepare the Host and Choose VM Resources

Prepare an x86-64 Windows host with VirtualBox installed and a Debian 13 amd64 netinst ISO whose signature and checksum you have verified. Hardware virtualization and coexistence with other hypervisors depend on the host environment. If the VM fails to start, identify the cause before changing Windows security settings.

Settings Practice Values Reason for Selection and Points to Check
Guest Type Debian 13, 64-bit Matches the amd64 image. Do not select an ARM guest.
CPU 2 Two virtual CPUs are a starting point for server exercises. Leave sufficient processor capacity for Windows and other applications.
Memory 4,096 MiB These values consider installation and additional service practice, and do not represent the minimum requirements of Debian.
System Disk Dynamically allocated VDI, 40 GiB The initial file can be smaller than its maximum virtual capacity. Allow host free space for disk growth and snapshots.
Firmware & Display EFI·VMSVGA Keeps the firmware method used during installation. Does not arbitrarily change BIOS/EFI after installation.
Network Adapter 1, NAT Provides the guest with an outbound path to package repositories. Port forwarding is not added at this step.

Hardware Requirements in the Debian Installation Guide also distinguish between installation types and the actual server usage. The table above is the practical design for this course and does not guarantee sufficient operating specifications for all servers. If the host lacks resources, first reduce the number of VMs running simultaneously and the scope of practical services.

Create the VM in VirtualBox Manager

The configuration verification environment in this document is VirtualBox 7.2.10 on a Windows host. Screen language and layout may differ depending on the version, so compare the values of the items as well. The official screen flow can be checked in VirtualBox 7.2 Creating a New VM Guide.

  1. In VirtualBox Manager, select New, and specify a name and dedicated storage folder that distinguish it from existing VMs. For example, use a descriptive name like LF-Debian13-Lab.
  2. Select the 64-bit type of Debian 13 and the verified amd64 ISO. Deselect Install OS Using Unattended Installation so that you can make the installation choices yourself. If there is no Debian 13 item in the version, check the supported types and versions and do not arbitrarily select a different architecture.
  3. Allocate 2 CPUs and 4,096 MiB of memory, and ensure EFI is enabled. Do not allocate memory close to the host's total capacity.
  4. Create a new dynamic VDI instead of using an existing disk and set the maximum size to 40 GiB. After creation is complete, go to Settings → Storage and check that the system disk and ISO are connected to different media.
  5. Open Settings → Network and confirm that the first adapter is set to NAT. Disable shared clipboard and drag-and-drop, and leave the VM powered off.

You do not need to copy the ISO file to the VM folder. However, if you move the path of the connected ISO or delete the file, the virtual optical drive may not be able to find that file. When moving the original file, specify the new path while the VM is turned off.

Create the Same Configuration with PowerShell

To configure by command, select either the GUI method or the method below. If you have already created a VM with the same name using the GUI, do not continue executing the code below. Execute in Windows PowerShell, and paste the full path of the ISO into the input field without quotation marks. The storage location is a dedicated subfolder under the user profile named VirtualBox VMs.

$ErrorActionPreference = 'Stop'
$vbox = Join-Path $env:ProgramFiles 'Oracle\VirtualBox\VBoxManage.exe'
if (-not (Test-Path -LiteralPath $vbox)) { throw 'Check the VirtualBox executable path.' }
$vmName = 'LF-Debian13-Lab'
$vmBase = Join-Path $env:USERPROFILE 'VirtualBox VMs'
$vmDir = Join-Path $vmBase $vmName
$isoPath = (Resolve-Path -LiteralPath (Read-Host 'Full path to the verified ISO')).Path
if ([System.IO.Path]::GetExtension($isoPath) -ne '.iso') { throw 'Select an ISO file.' }

function Invoke-LabVBox {
    param([string[]]$Arguments)
    & $vbox @Arguments
    if ($LASTEXITCODE -ne 0) { throw ('VirtualBox operation failed: ' + ($Arguments -join ' ')) }
}

$registered = & $vbox list vms
if ($LASTEXITCODE -ne 0) { throw 'Could not read the registered VM list.' }
if (($registered -match ('^"' + [regex]::Escape($vmName) + '" ')) -or
    (Test-Path -LiteralPath $vmDir)) {
    throw 'A VM or directory with this name already exists. Inspect it first.'
}
New-Item -ItemType Directory -Path $vmBase -Force | Out-Null
Invoke-LabVBox -Arguments @('createvm', '--name', $vmName, '--ostype', 'Debian13_64', '--basefolder', $vmBase, '--register')
Invoke-LabVBox -Arguments @('modifyvm', $vmName, '--memory', '4096', '--cpus', '2', '--firmware', 'efi', '--nic1', 'nat', '--boot1', 'dvd', '--boot2', 'disk', '--boot3', 'none', '--boot4', 'none', '--graphicscontroller', 'vmsvga', '--vram', '16', '--clipboard-mode', 'disabled', '--drag-and-drop', 'disabled')
$diskPath = Join-Path $vmDir 'system.vdi'
Invoke-LabVBox -Arguments @('createmedium', 'disk', '--filename', $diskPath, '--size', '40960', '--format', 'VDI', '--variant', 'Standard')
Invoke-LabVBox -Arguments @('storagectl', $vmName, '--name', 'SATA', '--add', 'sata', '--controller', 'IntelAhci')
Invoke-LabVBox -Arguments @('storageattach', $vmName, '--storagectl', 'SATA', '--port', '0', '--device', '0', '--type', 'hdd', '--medium', $diskPath)
Invoke-LabVBox -Arguments @('storageattach', $vmName, '--storagectl', 'SATA', '--port', '1', '--device', '0', '--type', 'dvddrive', '--medium', $isoPath)
Invoke-LabVBox -Arguments @('showvminfo', $vmName, '--machinereadable')

The helper function stops the script when VBoxManage returns a nonzero exit code. This configuration was tested on VirtualBox 7.2.10 through native VBoxManage calls from a host-side Python helper; the complete PowerShell version above was syntax-checked. Do not rerun the creation script against a VM that already exists.

Check detailed options and supported names based on VBoxManage 7.2 commands reference. The example checks the exit code to avoid continuing with the next command if a failure occurs. If there is a failure in the middle, instead of starting over, check the current state of the VM and the media created.

Prepare NAT Networking and Console Access

NAT (Network Address Translation) is a method where the guest’s external connection is handled through the host’s network. Access from the guest to package repositories through basic NAT is different from other computers connecting to the guest’s server ports. To access the guest via SSH from the host, later you need to set up a separate access path, such as limited port forwarding, and also check the SSH server and firewall inside the guest.

Bridged networking allows the guest to participate in the physical network as a separate device. Since there is no need to expose services to the external network from the beginning, it is not used as the default in this practice. However, this does not mean that NAT is an isolation policy that blocks all external access for the guest. Check the mode in use and actual connectivity against the VirtualBox networking documentation.

The virtual console is an access path that directly handles the VM's screen and keyboard. Even if Debian's IP address, DNS, or SSH settings are incorrect, you can investigate through the console if the VM process and screen are normal. Make sure you know whether you can open the screen of the VM in the VirtualBox Manager and how to use the host key. SSH is not left as the only recovery path.

Check Settings and Restore a Pre-installation Snapshot

After creation, check memory, CPU, firmware, and network in the settings inspection. If created using the previous command method, use $vbox and $vmName in the same PowerShell session. If created via GUI, first set the following two variables according to the actual names.

$vbox = Join-Path $env:ProgramFiles 'Oracle\VirtualBox\VBoxManage.exe'
$vmName = 'LF-Debian13-Lab'
& $vbox showvminfo $vmName --machinereadable
if ($LASTEXITCODE -ne 0) { throw 'Could not read VM settings.' }

The settings output should include the following values. The full output also contains additional information such as storage paths and UUIDs.

memory=4096
cpus=2
firmware="EFI"
nic1="nat"
VMState="poweroff"

The comparisons below are only performed when the dedicated empty VM without an installed operating system is powered off. Restoring a snapshot of a VM that is already in use may cause subsequent disk changes to be lost. First, check the current target and its status, and if necessary data exists, prepare an independent backup. If the snapshot name already exists, inspect it before choosing a different name; do not assume it represents this empty VM state.

& $vbox snapshot $vmName take 'prepared-empty' --description 'Before Debian installation'
if ($LASTEXITCODE -ne 0) { throw 'Could not create the snapshot.' }
& $vbox modifyvm $vmName --memory 3840
if ($LASTEXITCODE -ne 0) { throw 'Could not apply the comparison setting.' }
& $vbox showvminfo $vmName --machinereadable
if ($LASTEXITCODE -ne 0) { throw 'Could not read VM settings.' }
& $vbox snapshot $vmName restore 'prepared-empty'
if ($LASTEXITCODE -ne 0) { throw 'Could not restore the snapshot.' }
& $vbox showvminfo $vmName --machinereadable
if ($LASTEXITCODE -ne 0) { throw 'Could not read settings after restoration.' }

In the practice, we kept other conditions such as CPU allocation and disk configuration unchanged and only changed the memory value. When checking a new powered-off VM from 4,096 MiB → 3,840 MiB and then restoring the snapshot, it returned to 4,096 MiB. This result confirms the host VM configuration and snapshot restoration settings, but it does not yet confirm successful Debian installation or guest file restoration.

Differencing disks created by snapshots are managed by VirtualBox. Selecting and deleting the original VDI or snapshot files in the file explorer can break the connection. When cleaning up snapshots, check the target in the management function, and distinguish that restoration and deletion are not the same actions.

When to Stop and What to Record

  • If there is a VM or folder with the same name, or the disk is different from expected, stop creating a new one and check the purpose of the existing one.
  • If it does not start due to a virtualization error, first record the actual error and the host’s virtualization support status. Do not disable security features without confirming support.
  • If you cannot find the ISO, check the downloads folder and the optical drive connection. Do not swap the system VDI and ISO connections.
  • If the host space is insufficient, do not continue writing new data. Preserve necessary backups on another device, then check the capacity of each VM and snapshot.

In the verification environment, we created only a new VM called LF-Debian13-Lab-20261116 while keeping the existing VM registrations. The name and storage location the reader uses can differ, but the VM name, system VDI, connected ISO, snapshot name, firmware, and network mode should be recorded together. If the VM folder and snapshots are on the same host disk, an independent backup against the failure of that disk is not in place.

The completion criteria for this step are that a dedicated VM and disk are created, the verified ISO is connected, and resources, NAT, console access methods, and pre-installation restore points are prepared. In exercises handling boot files and storage devices, it is important to develop the habit of recording not just that the screen changed, but which objects were modified and how you verified their original state.