This guide will help you configure a Debian 12 virtual machine on a Windows host, including adjustments for screen resolution, installation of necessary software, and system configuration.
- Hyper-V enabled on Windows
- Debian 12 ISO
- Internet connection for the VM
Run this command if you struggle to see your screen while running the setup:
xrandr | awk '/ connected/ { print $1 }' | xargs -I{} xrandr --output {} --mode 1920x1080
- Choose "New VM" (not quick create)
- Select "Generation 2"
- Go to Settings:
- Disable Secure Boot
- Enable guest services in the Integration Services.
Install Debian 12 as you prefer. Remember to set up both root/sudo and user accounts. During the final step of the installation:
- Configure XFCE
- Disable Gnome and Debian Desktop
- Leave "Standard System Utilities" enabled
After the first boot:
# Login with your user account (not root)
su root # Switch to root on that profile
apt install git -y # Install git
git clone https://github.com/pentestfunctions/test-setup.git
cd test-setup
chmod +x setup.sh
./setup.sh
After running setup.sh
, the system will reboot (you can turn it off at this point).
Run the following command in an administrator PowerShell on the Windows host (MAKE SURE YOU CHANGE DebianTest to your Hyper-V image name):
Set-VM -VMName DebianTest -EnhancedSessionTransportType HvSocket
When you boot the VM, on the login screen you will be prompted for enhanced session mode (RDP) after a few seconds. You can adjust the resolution now if you wish.
Once logged into the Xorg session, run:
wget https://github.com/pentestfunctions/test-setup/blob/main/configure.sh
chmod +x configure.sh
./configure.sh
Then simply setup your .bashrc with this one
https://github.com/pentestfunctions/test-setup/blob/main/.bashrc