How to Install Ubuntu on Hyper-V Virtual Machine in Windows 11

    Create a new hyper-v virtual machine from the menu Action > New > Virtual Machine

    Give name to the VM e.g. developer

    Select the VM generation, this depends upon whether your system support for UEFI style boot or not, for our purpose we will sect generation 2

    Choose default memory depending on your needs

    Also, select the Default switch for network connectivity

    Select the default and specify the storage size required by your VM.

    Choose the installation option from Image file located in your local folder.

    Next > Finish.

    If the ISO was windows then we just need to start the VM, but in our case the ISO is Ubuntu 24 Desktop , so we need to do some settings changed for it to boot, other wise you will get error.

    Right click on the VM > Settings > Security TAB and from template select Microsoft UEFI Certificate Authority

    Start the VM

    Give username and password to the Ubuntu VM

    (Optional)To fix the resolution issue

    sudo apt update -y && sudo apt upgrade -y
    sudo nano /etc/default/grub
    # Add following line after ‘splash’ type below command
    # video=hyperv_fb:1920x1200
    # E.g., GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1200"
    sudo update-grub
    sudo poweroff
    Bash

    Open Powershell on your host computer ( Windows 11 ) run as Administrator

    Type the below command, change the bold font according to your PC

    set-vmvideo -vmname ubuntu -horizontalresolution:1920 -verticalresolution:1200 -resolutiontype single
    PowerShell

    Enable clipboard(Optional)

    Settings > Integration service > Guest services > Apply

    Update apt package lists and upgrade existing packages:

    sudo apt update -y && sudo apt upgrade -y
    sudo apt -y install linux-virtual linux-cloud-tools-virtual linux-tools-virtual -y
    sudo update-initramfs -u
    sudo reboot
    Bash


    Discover more from Altgr Blog

    Subscribe to get the latest posts sent to your email.

    Leave a Reply

    Your email address will not be published. Required fields are marked *