How to run Ubuntu Server on Hyper-V
Please share with your friends...
  • 1
  • 1
  •  
  •  
  • 2
  • 1
  •  
  •  
  •  
  •  
    5
    Shares


⇐ BackPageNext ⇒

Create Virtual Machine

Virtual machine sizing (processors, memory, storage, etc) can be as per the Ubuntu Server System Requirements.

There are two methods of creating a new virtual machine; Hyper-V Manager using a simple wizard-based interface, and Windows PowerShell using an advanced and scriptable command-line interface.

Hyper-V Manager
The following instructions are used to create a new Hyper-V virtual machine for Ubuntu Server using Hyper-V Manager.

  1. From the Actions menu in Hyper-V Manager, select NewVirtual Machine. The New Virtual Machine Wizard window will open and the Before You Begin page will be displayed.
    New Virtual Machine Wizard: Before You Begin
    Before You Begin
  2. Click Next. The Specify Name and Location page will be displayed.
    New Virtual Machine Wizard: Specify Name and Location
    Specify Name and Location
  3. From the Specify Name and Location page, perform the following actions:
    1. Type a Name for this virtual machine; and
    2. Specify whether you want to Store the virtual machine in a different location.
  4. Click Next. The Specify Generation page will be displayed.
    New Virtual Machine Wizard: Specify Generation
    Specify Generation
  5. Select Generation 2 and click Next. The Assign Memory page will be displayed.
    New Virtual Machine Wizard: Assign Memory
    Assign Memory
  6. From the Assign Memory page, perform the following actions:
    1. Type a value for Startup memory; and
    2. Confirm Use Dynamic memory for this virtual machine is selected.
  7. Click Next. The Configure Networking page will be displayed.
    New Virtual Machine Wizard: Configure Networking
    Configure Networking
  8. Select an External network Connection to provide your virtual machine with Internet access, and click Next. The Connect Virtual Hard Disk page will be displayed.
    New Virtual Machine Wizard: Connect Virtual Hard Disk
    Connect Virtual Hard Disk
  9. From the Connect Virtual Hard Disk page, perform the following actions:
    1. Select Create a virtual hard disk;
    2. Type a Name for this virtual hard disk;
    3. Set the Location for this virtual hard disk, if not using the default; and
    4. Specify the Size for this virtual hard disk, with a default size of 127 GB.
  10. Click Next. The Installation Options page will be displayed.
    New Virtual Machine Wizard: Installation Options
    Installation Options
  11. From the Installation Options page, perform the following actions:
    1. Select Install an operating system from a bootable image file; and
    2. Set the Image file to the location of the Ubuntu Server installation disc image.
  12. Click Next. The Summary page will be displayed.
    New Virtual Machine Wizard: Summary
    Summary
  13. Click Finish. The New Virtual Machine Wizard window will close.
  14. Select the new Ubuntu Server virtual machine in Hyper-V Manager and open Settings. The Settings window will open.
  15. Select Firmware from the Hardware list. The Firmware options will be displayed.
    Settings for Ubuntu Server: Firmware
    Firmware: Boot from DVD Drive
  16. Confirm Boot order lists the DVD Drive as the first boot device.
  17. Select Security from the Hardware list. The Security options will be displayed.
    Settings for Ubuntu Server: Security
    Security: Secure Boot Enabled
    Secure Boot support for Linux-based guest operating systems is only available in Windows Server 2016, Windows 10 and later. If your Hyper-V host is an earlier version of Windows, Secure Boot will need to be disabled.
  18. From the Securty options page, perform the following actions:
    1. Select Enable Secure Boot.
    2. Select Microsoft UEFI Certificate Authority from the Template list.
  19. Select Memory from the Hardware list. The Memory options will be displayed.
    Settings for Ubuntu Server: Memory
    Memory: Dynamic Memory Enabled
  20.  From the Memory options page, perform the following actions:
    1. Confirm Enable Dynamic Memory is selected.
    2. Type a suitable value for Minimum RAM; and
    3. Type a suitable value for Maximum RAM.
  21. Select Processor from the Hardware list. The Processor options will be displayed.
    Settings for Ubuntu Server: Processor
    Processor: Virtual Processors
  22. Specify the Number of virtual processors to be used by this virtual machine.
  23. Click OK to accept changes and close the Settings window.
  24. From the Actions menu in Hyper-V Manager, select Start. The Ubuntu Server virtual machine will enter a Running state.
  25. From the Actions menu in Hyper-V Manager, select Connect. The Virtual Machine Connection window will be displayed.
Windows PowerShell
The following instructions can be used to create a new Hyper-V Virtual Machine for Ubuntu Server using Windows PowerShell, and are intended for use by advanced users.

  1. Start the Windows PowerShell ISE with elevated privileges (Run as Administrator).
  2. Copy, paste and run the following script from the Windows PowerShell ISE:
    The script will produce output similar to the following:

    ComputerName            : WINDOWS-PC
    Path                    : C:\Hyper-V\Virtual Hard Disks\Ubuntu Server.vhdx
    VhdFormat               : VHDX
    VhdType                 : Dynamic
    FileSize                : 4194304
    Size                    : 136365211648
    MinimumSize             : 
    LogicalSectorSize       : 512
    PhysicalSectorSize      : 4096
    BlockSize               : 1048576
    ParentPath              : 
    DiskIdentifier          : 00000000-0000-0000-0000-000000000000
    FragmentationPercentage : 0
    Alignment               : 1
    Attached                : False
    DiskNumber              : 
    Number                  : 
    
    Name             : Ubuntu Server
    State            : Off
    CpuUsage         : 0
    MemoryAssigned   : 0
    MemoryDemand     : 0
    MemoryStatus     : 
    Uptime           : 00:00:00
    Status           : Operating normally
    ReplicationState : Disabled
    Generation       : 2
  3. Start the Ubuntu Server Virtual Machine, using the following command:
    Start-VM $VM_Name

    The Ubuntu Server virtual machine will enter a Running state.

  4. Open the Virtual Machine Connection console, using the following command:
    vmconnect $env:COMPUTERNAME $VM_Name

    The Virtual Machine Connection window will be displayed.

⇐ BackPageNext ⇒

How to run Ubuntu Server on Hyper-V

Please share with your friends...
  • 1
  • 1
  •  
  •  
  • 2
  • 1
  •  
  •  
  •  
  •  
    5
    Shares
Tagged on:                             

One thought on “How to run Ubuntu Server on Hyper-V

  • 05/03/2018 at 1:53 AM
    Permalink

    Tried something like this Ubuntu 18.04 and hyper-v only bad thing is no audio.

    Reply

Leave a Reply