← Back to Home

Hyper-V Installation Guide

Install CodeHero PRO using Hyper-V on Windows. Hyper-V is Microsoft's built-in hypervisor — no extra software needed, but it requires Windows Pro or Enterprise edition.

Requirements

ResourceMinimumRecommended
OSWindows 10/11 Pro, Enterprise, or EducationWindows 11 Pro
RAM4 GB available for VM8 GB available for VM
Disk25 GB free40 GB free
CPU2 cores, VT-x enabled4 cores
NetworkInternet connectionStable broadband
Windows Home users: Hyper-V is not available on Windows Home edition. Use VirtualBox or WSL2 instead.

Check Your Windows Edition

Press Win + R, type winver, and press Enter. The dialog shows your Windows edition. You need Pro, Enterprise, or Education.

Step 1: Enable Hyper-V

Method A: Windows Features Dialog

  1. Press Win + R, type optionalfeatures, and press Enter
  2. In the Windows Features window, check:
    • Hyper-V (expand and check all sub-items)
    • Virtual Machine Platform
    • Windows Hypervisor Platform
  3. Click OK
  4. Wait for the features to install
  5. Restart your computer when prompted

Method B: PowerShell (Run as Administrator)

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Restart your computer when prompted.

Verify Hyper-V Is Enabled

After restart, search for "Hyper-V Manager" in the Start menu. If it appears, Hyper-V is ready.

Step 2: Download Ubuntu ISO

  1. Go to: https://ubuntu.com/download/server
  2. Download Ubuntu Server 24.04 LTS (x86_64)
  3. Save the ISO file (approximately 2.5 GB)

Step 3: Create the Virtual Machine

Using Hyper-V Manager (GUI)

  1. Open Hyper-V Manager (search in Start menu)
  2. In the right panel, click New > Virtual Machine
  3. Click Next on the introduction page
  4. Specify Name and Location: Name: codehero — Click Next
  5. Specify Generation: Select Generation 2 (recommended for Ubuntu 24.04) — Click Next
  6. Assign Memory: Startup memory: 4096 MB — Uncheck "Use Dynamic Memory" — Click Next
  7. Configure Networking: Connection: Select Default Switch (provides NAT-style networking) — Click Next
  8. Connect Virtual Hard Disk: Select "Create a virtual hard disk" — Size: 40 GB — Click Next
  9. Installation Options: Select "Install an operating system from a bootable image file" — Browse to the Ubuntu ISO — Click Next
  10. Click Finish

Using PowerShell

# Create the VM
New-VM -Name "codehero" -Generation 2 -MemoryStartupBytes 4GB -NewVHDPath "C:\Hyper-V\codehero.vhdx" -NewVHDSizeBytes 40GB -SwitchName "Default Switch"

# Configure CPU
Set-VMProcessor -VMName "codehero" -Count 2

# Disable dynamic memory
Set-VMMemory -VMName "codehero" -DynamicMemoryEnabled $false

# Add the Ubuntu ISO
Add-VMDvdDrive -VMName "codehero" -Path "C:\path\to\ubuntu-24.04-live-server-amd64.iso"

# Set boot order to DVD first
$dvd = Get-VMDvdDrive -VMName "codehero"
Set-VMFirmware -VMName "codehero" -FirstBootDevice $dvd

Step 4: Disable Secure Boot

Ubuntu requires disabling Secure Boot on Generation 2 Hyper-V VMs, or changing it to use the Microsoft UEFI Certificate Authority template.

GUI Method

  1. In Hyper-V Manager, right-click codehero > Settings
  2. Go to Security
  3. Either:
    • Uncheck "Enable Secure Boot" entirely, or
    • Keep Secure Boot enabled but change the template to Microsoft UEFI Certificate Authority
  4. Click OK

PowerShell Method

# Option 1: Disable Secure Boot
Set-VMFirmware -VMName "codehero" -EnableSecureBoot Off

# Option 2: Use Microsoft UEFI Certificate Authority (keeps Secure Boot on)
Set-VMFirmware -VMName "codehero" -SecureBootTemplate MicrosoftUEFICertificateAuthority

Step 5: Install Ubuntu

Start the VM

  1. In Hyper-V Manager, right-click codehero > Connect (opens the VM console window)
  2. Click Start in the console window

Ubuntu Installation Steps

  1. Select Try or Install Ubuntu Server and press Enter
  2. Language: Select your language
  3. Keyboard: Select your keyboard layout
  4. Type of Install: Ubuntu Server
  5. Network: Ubuntu auto-detects the network. Note the IP address if shown.
  6. Proxy: Leave empty
  7. Mirror: Leave default
  8. Storage: Use an entire disk > select the virtual disk > Done > Done > Continue
  9. Profile Setup:
    • Your name: Claude Admin
    • Server name: codehero-server
    • Username: claude
    • Password: Choose a password (remember it)
  10. Ubuntu Pro: Skip for now
  11. SSH: Check "Install OpenSSH server"
  12. Featured Snaps: Skip
  13. Wait for installation (5-10 minutes)
  14. Select Reboot Now
  15. The VM may hang on "Please remove the installation medium" — just press Enter or power cycle the VM

Remove the ISO After Installation

After the first reboot:

  1. Shut down the VM
  2. Right-click the VM > Settings > SCSI Controller > DVD Drive
  3. Change to None
  4. Start the VM again

PowerShell:

Remove-VMDvdDrive -VMName "codehero" -ControllerNumber 0 -ControllerLocation 1

First Login

At the login prompt:

Step 6: Install CodeHero

Run these commands inside the VM. First, copy the ZIP file provided with your CodeHero PRO license into the VM, then:

sudo apt update
sudo apt install -y unzip wget net-tools
sudo su
cd /root
unzip codehero-pro-release-4.6.3.zip
cd codehero
chmod +x setup.sh
./setup.sh

Wait 10-15 minutes for installation to complete.

Find Your VM IP Address

hostname -I

Write down the IP (e.g., 172.19.240.5).

Step 7: Access the Dashboard

On your Windows host, open a browser and go to:

https://YOUR_VM_IP:9453

Default Login

Change Default Passwords

sudo /opt/codehero/scripts/change-passwords.sh

Browser Security Warning

BrowserHow to Proceed
ChromeClick "Advanced" then "Proceed to site (unsafe)"
FirefoxClick "Advanced..." then "Accept the Risk and Continue"
EdgeClick "Advanced" then "Continue to site (unsafe)"

Daily Usage

GUI (Hyper-V Manager)

ActionSteps
StartRight-click VM > Start
ConnectRight-click VM > Connect (opens console)
Shut DownRight-click VM > Shut Down
Turn OffRight-click VM > Turn Off (force, use only if Shut Down hangs)
DeleteRight-click VM > Delete
Save StateRight-click VM > Save (hibernates the VM)

PowerShell Commands

# Start the VM
Start-VM -Name "codehero"

# Graceful shutdown
Stop-VM -Name "codehero"

# Force power off
Stop-VM -Name "codehero" -Force

# Save state (hibernate)
Save-VM -Name "codehero"

# Get VM info
Get-VM -Name "codehero"

# Get VM IP address
Get-VM -Name "codehero" | Select -ExpandProperty NetworkAdapters | Select IPAddresses

# Delete the VM
Remove-VM -Name "codehero" -Force

# Also delete the virtual hard disk
Remove-Item "C:\Hyper-V\codehero.vhdx"

SSH into the VM

From PowerShell or Windows Terminal:

ssh claude@YOUR_VM_IP

Troubleshooting

"Hyper-V" Not Found in Start Menu

Hyper-V may not be enabled. Run in PowerShell (Admin):

Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V

If the state is "Disabled", enable it:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Cannot Enable Hyper-V

VM Won't Boot / Black Screen

  1. Verify Secure Boot is disabled or using the correct template (see Step 4)
  2. Ensure the ISO is attached and set as the first boot device
  3. Try using Generation 1 instead of Generation 2

No Network in the VM

  1. Verify the VM is connected to "Default Switch"
  2. Check the virtual switch:
    Get-VMSwitch
  3. If "Default Switch" is missing, create an external switch:
    New-VMSwitch -Name "External" -NetAdapterName "Ethernet" -AllowManagementOS $true

Cannot Access Dashboard from Browser

  1. Get the VM IP:
    Get-VM -Name "codehero" | Select -ExpandProperty NetworkAdapters | Select IPAddresses
  2. Check services inside the VM:
    sudo systemctl status codehero-web
  3. Windows Firewall may block the connection. Add an inbound rule for port 9453.

VM Runs Slowly

  1. Increase memory:
    Set-VMMemory -VMName "codehero" -StartupBytes 8GB
  2. Increase CPUs:
    Set-VMProcessor -VMName "codehero" -Count 4
  3. Disable Dynamic Memory if enabled:
    Set-VMMemory -VMName "codehero" -DynamicMemoryEnabled $false

"Default Switch" IP Changes After Reboot

This is normal behavior with the Default Switch. Get the new IP:

Get-VM -Name "codehero" | Select -ExpandProperty NetworkAdapters | Select IPAddresses

For a static IP, consider creating an External Virtual Switch instead of using Default Switch.