
⇐ Back | Page | Next ⇒ |
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.
- From the Actions menu in Hyper-V Manager, select New → Virtual Machine. The New Virtual Machine Wizard window will open and the Before You Begin page will be displayed.
Before You Begin - Click Next. The Specify Name and Location page will be displayed.
Specify Name and Location - From the Specify Name and Location page, perform the following actions:
- Type a Name for this virtual machine; and
- Specify whether you want to Store the virtual machine in a different location.
- Click Next. The Specify Generation page will be displayed.
Specify Generation - Select Generation 2 and click Next. The Assign Memory page will be displayed.
Assign Memory - From the Assign Memory page, perform the following actions:
- Type a value for Startup memory; and
- Confirm Use Dynamic memory for this virtual machine is selected.
- Click Next. The Configure Networking page will be displayed.
Configure Networking - 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.
Connect Virtual Hard Disk - From the Connect Virtual Hard Disk page, perform the following actions:
- Select Create a virtual hard disk;
- Type a Name for this virtual hard disk;
- Set the Location for this virtual hard disk, if not using the default; and
- Specify the Size for this virtual hard disk, with a default size of 127 GB.
- Click Next. The Installation Options page will be displayed.
Installation Options - From the Installation Options page, perform the following actions:
- Select Install an operating system from a bootable image file; and
- Set the Image file to the location of the Ubuntu Server installation disc image.
- Click Next. The Summary page will be displayed.
Summary - Click Finish. The New Virtual Machine Wizard window will close.
- Select the new Ubuntu Server virtual machine in Hyper-V Manager and open Settings. The Settings window will open.
- Select Firmware from the Hardware list. The Firmware options will be displayed.
Firmware: Boot from DVD Drive - Confirm Boot order lists the DVD Drive as the first boot device.
- Select Security from the Hardware list. The Security options will be displayed.
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. - From the Securty options page, perform the following actions:
- Select Enable Secure Boot.
- Select Microsoft UEFI Certificate Authority from the Template list.
- Select Memory from the Hardware list. The Memory options will be displayed.
Memory: Dynamic Memory Enabled - From the Memory options page, perform the following actions:
- Confirm Enable Dynamic Memory is selected.
- Type a suitable value for Minimum RAM; and
- Type a suitable value for Maximum RAM.
- Select Processor from the Hardware list. The Processor options will be displayed.
Processor: Virtual Processors - Specify the Number of virtual processors to be used by this virtual machine.
- Click OK to accept changes and close the Settings window.
- From the Actions menu in Hyper-V Manager, select Start. The Ubuntu Server virtual machine will enter a Running state.
- 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.
- Start the Windows PowerShell ISE with elevated privileges (Run as Administrator).
- Copy, paste and run the following script from the Windows PowerShell ISE:
[gist]340971bab33dda996780a63691b4f257[/gist] 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
- Start the Ubuntu Server Virtual Machine, using the following command:
Start-VM $VM_Name
The Ubuntu Server virtual machine will enter a Running state.
- Open the Virtual Machine Connection console, using the following command:
vmconnect $env:COMPUTERNAME $VM_Name
The Virtual Machine Connection window will be displayed.
⇐ Back | Page | Next ⇒ |
How to run Ubuntu Server on Hyper-V
Tried something like this Ubuntu 18.04 and hyper-v only bad thing is no audio.