Skip to content

Instantly share code, notes, and snippets.

@ryanmoralesaz
Created January 9, 2026 00:29
Show Gist options
  • Select an option

  • Save ryanmoralesaz/a312ae36371ea79d3e09cb88937db043 to your computer and use it in GitHub Desktop.

Select an option

Save ryanmoralesaz/a312ae36371ea79d3e09cb88937db043 to your computer and use it in GitHub Desktop.
NOTES HOW TO START VBOX INSTANCE with DESKTOP SHORTCUT
How to create a desktop shortcut to start vbox
# Make sure you have this in your $profile
$env:PATH += ";C:\Program Files\Oracle\VirtualBox"
# get the name of your instance by running
`vboxmanage list vms`
# Put the below script in a folder in your documents (call it "start-linux-server.ps1"
# make sure to change the name of the vmName to your instance name
```bash
$vmName = "NAME_OF_YOUR_INSTANCE"
Write-Host "Starting $vmName..." -ForegroundColor Cyan
& "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm $vmName --type headless
# 2. Wait for SSH to become available
while (-not (Test-NetConnection -ComputerName "192.168.56.101" -Port 22 -InformationLevel Quiet)) {
Start-Sleep -Seconds 2
}
# 3. Connect via SSH
# Note: This assumes you have port forwarding set up (Host 2222 -> Guest 22)
Write-Host "SSH is ready! Connecting..." -ForegroundColor Green
#make sure the command below has the correct host alias for your identity file
ssh student-linux
Write-Host "`nScript finished. Press any key to close this window..." -ForegroundColor Gray
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp")
```
# right click the desktop and create new desktop shortcut
# paste the following into the path
powershell.exe -NoExit -ExecutionPolicy Bypass -File "C:\Users\PATH\TO\SCRIPT\start-linux.ps1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment