Windows 8 and 8.1 Forums


Hyper-V – Create Linux Virtual Machine in Windows 8

Page 1 of 2 12 LastLast
  1. #1
    Hyper-V – Create Linux Virtual Machine in Windows 8

    Hyper-V – Create Linux Virtual Machine in Windows 8
    How to Create a Linux Hyper-V Virtual Machine in Windows 8
    Published by Kari is offline
    19 Mar 2012
    Default Hyper-V – Create Linux Virtual Machine in Windows 8

    How to Create a Linux Hyper-V Virtual Machine in Windows 8


    information   Information
    Although best when running Windows guests, Windows 8 built-in Microsoft Hyper-V can also be used to run Linux guests. Officially Hyper-V only supports SUSE and Red Hat enterprise server distributions but with a few simple tricks any Linux distro can be installed.

    In this tutorial we will install both OpenSUSE 12.1 and Ubuntu 11.10 distros. Please notice that I have still not found how to get sound working on Hyper-V Linux guests. Also changing the resolution seems to be extremely tricky, following this tutorial you can set OpenSUSE display resolution freely during the installation procedure but it cannot be changed later on. For Ubuntu I have only managed 800 * 600 resolution.

    Forgetting the missing sound and restricted resolution, Hyper-V Linux guests are fully functional operating systems, ideal for getting to know and practise Linux and virtualization.

    Tips from other users regarding sound and resolution issues welcome!


    For this tutorial you need:





    1) Install OpenSUSE 12.1 guest on Hyper-V

    1.1. Create a virtual private network switch


    For a Linux guest to work on Hyper-V it needs to use so called Legacy Network Adapter, a private one while installing and an internal or external one when running. Before installing OpenSUSE we need to create a private network switch using Legacy Network Adapter.


    1. Open Hyper-V Virtual Switch Manager
      .
      Click image for larger version
      .
    2. Click New virtual network switch
    3. Select Private
    4. Click Create Virtual Switch
      .
      Click image for larger version
      .
    5. Give your Virtual Switch a name, select Private Network, click OK to apply and save settings
      .
      Click image for larger version
      .

    1.2. Create a virtual machine
    1. Click New on Actions pane on Hyper-V Manager, select Virtual Machine
      .
      Click image for larger version
      .
    2. New Virtual Machine Wizard opens. Click Next
      .
      Click image for larger version
      .
    3. Specify the name of the virtual machine and where it should be saved. Click Next
      .
      Click image for larger version
      .
    4. Assign RAM. Notice that the RAM assigned to a virtual machine is taken from the total of RAM on your host PC; to run virtual machine well you need to balance between the RAM of your host and virtual machine. For OpenSUSE I recommend using 1 GB (1024 MB); if less you can have issues with GUI, more does not add speed or benefit in other way. OpenSUSE runs well with 1 GB. Click Next
      .
      Click image for larger version
      .
    5. In Network Configuration at this point select Connection: Not Connected. We will add virtual switch later
      .
      Click image for larger version
      .
    6. Specify name, location and size of the virtual hard disk. For OpenSUSE 8 GB is enough to install and run, here I added some more for storage space. Click Next
      .
      Click image for larger version
      .
    7. Specify the location of install media, an ISO file or CD/DVD. Click Next
      .
      Click image for larger version
      .
    8. Click Finish
      .

    1.3. Add Private Legacy Network Switch

    1. Open your vm settings
      .
      Click image for larger version
      .
    2. Remove Network Adapter. This needs to be done for Legacy Network Adapter to work
      .
      Click image for larger version
      .
    3. Click Add Hardware, select Legacy Network Adapter, click Add
      .
      Click image for larger version
      .

    4. Set Legacy Network Adapter to use the Private switch you created earlier
      .
      Click image for larger version
      .
    5. Click Apply, click OK

    1.4. Install OpenSUSE

    1. Select your OpenSUSE vm on Virtual Machines list, click Connect
      .
      Click image for larger version
      .
    2. Click Start to start vm
      .
      Click image for larger version
      .
    3. Press F3 to select resolution. Notice that as I mentioned earlier I have still not found how to change resolution later so this selection now determines what resolution your OpenSUSE vm is going to use
      .
      Click image for larger version
      .
    4. Select Installation and press Enter
      .
      Name:  Install_OpenSUSE_on_Hyper-V_014.png
Views: 59513
Size:  23.8 KB
      .

    5. Select your preferred language and keyboard layout. OpenSUSE will be installed on the language you select here, using selected keyboard layout. Click Next
      .
      Click image for larger version
      .

    6. 6. Click Next
      .
      Click image for larger version
      .

    7. Select your Time Zone, click Next
      .
      Click image for larger version
      .

    8. Select KDE desktop, click Next. In my tests the Gnome desktop has refused to work
      .
      Click image for larger version
      .
    9. Click Next
      .
      Click image for larger version
      .

    10. Enter your user credentials, click Next
      .
      Click image for larger version
      .

    11. Click Install, confirm by clicking Install again
      .
      Click image for larger version
      .
    12. After Installation is done OpenSUSE reboots by itself. Select Boot from Hard Disk after reboot
      .
      Click image for larger version
      .
    13. Select Desktop – - OpenSUSE
      .
      Click image for larger version
      .

    14. OpenSUSE makes last configurations and boots to KDE desktop. Shut down vm as soon as you enter the desktop
      .
      Click image for larger version
      .
    15. Open OpenSUSE settings, set Legacy Network Adapter to use an external switch. See Hyper-V - How to Use in Windows 8 to see how to create an external switch
      .
      Click image for larger version
      .
    16. Start OpenSUSE vm, log in and you are ready to go
      .
      Click image for larger version


    2. Install Ubuntu 11.10 guest on Hyper-V

    For how to create a private virtual switch, create Ubuntu virtual machine and add Private Legacy Network Adapter and making Ubuntu installation to use it, follow the steps 1.1., 1.2. and 1.3. as described above (Install OpenSUSE on Hyper-V).

    2.1. Install Ubuntu



    1. Connect and start vm as described above (Install OpenSUSE) on 1.4.1 and 1.4.2
    2. For Ubuntu (and all Debian family distros) to work on Hyper-V we need to disable Advanced Configuration and Power Interface (ACPI). When ACPI is enabled, Ubuntu does not support Legacy Network Driver needed to install and run it on Hyper-V. Press F6 to select installation options, select acpi=off, press Spacebar to select it, press ESC to exit Options menu
      .
      Click image for larger version
      .
    3. Select Install Ubuntu, press Enter
    4. Select the installation language
      .
      Click image for larger version
      .
    5. Select Install this third party software to add MPEG support, click Continue
      .
      Click image for larger version
      .
    6. Select Erase and Install, click Continue
      .
      Click image for larger version
      .
    7. Click Install Now
      .
      Click image for larger version
      .
    8. Select your Time Zone, click Continue
      .
      Click image for larger version
      .
    9. 8. Select your preferred keyboard layout, click Continue
      .
      Click image for larger version
      .
    10. Set your user credentials
      .
      Click image for larger version
      .
    11. Let Ubuntu install
      .
      Click image for larger version
      .
    12. When installation is completed click Restart Now
      .
      Name:  Install_Ubuntu_on_Hyper-V_010.png
Views: 57314
Size:  18.2 KB
      .
    13. When Ubuntu reboots and stops telling Please remove installation media, click Stop to stop and close vm. This ejects the installation media
      .
      Click image for larger version
      .
    14. Restart vm, log in
      .
      Click image for larger version
      .
    15. Click an empty spot on desktop, press CTRL+ALT+t to open Terminal (about the same as Command Prompt in Windows). To move to Root (about the same as in Windows an elevated Command Prompt), type sudo –i and press Enter. Enter your password to confirm, press Enter again
      .
      Click image for larger version
      .
    16. Now we need to edit Initramfs to add modules which offer support for Hyper-V integration components. We need to manually add modules for bus (= traffic between host and guest), storage and network. To do this, open Initramfs using your preferred editor. I use Nano in this example:
    17. Type nano /etc/initramfs-tools/modules and hit Enter to open Initramfs in Nano editor
      .
      Click image for larger version
      .
    18. Add these four lines at the end of the file
      hv_vmbus
      hv_storvsc
      hv_blkvsc
      hv_netvsc
      .
      Click image for larger version
      .
    19. Press CTRL+X to end editing, press Y to save changes. Press Enter to finally accept old Initramfs to be overwritten
      .
      Click image for larger version
      .
    20. Update Initramfs: type update-initramfs –u, press Enter
      .
      Name:  Install_Ubuntu_on_Hyper-V_018.png
Views: 57052
Size:  38.7 KB
      .
    21. Type exit and press Enter to exit root (admin mode), type exit and press Enter to close Terminal
      .
      Click image for larger version
      .
    22. Shut down vm
    23. See step 1.4.15. (Install OpenSUSE) above to switch Legacy Network Adapter to External Switch
    24. Start vm, login and you are ready to go
      .
      Click image for larger version
      .
      Click image for larger version


    Please feel free to comment and suggest changes!

    Kari


    Published by


    Kari's Avatar
    Old geek, new tricks



    Join Date: Jul 2009
    Location: A Finnish ex-pat in Leipzig, Germany
    Posts: 1,186


    Tutorial Tools


  2. #1



    Banned

    Join Date : Feb 2012
    Posts : 1,308
    Windows 8 enterprise x64
    Canada ca quebec


    Quote Originally Posted by Kari View Post
    ...... Please notice that I have still not found how to get sound working on Hyper-V Linux guests. Also changing the resolution seems to be extremely tricky, following this tutorial you can set OpenSUSE display resolution freely during the installation procedure but it cannot be changed later on. For Ubuntu I have only managed 800 * 600 resolution.

    Kari
    Hyper-V don't support sound in any client OS, it's also limited in resolution, if you want to have sound , you have to use Remote Desktop , same with the Resolution, Keep in mind that Hyper-V is design to run Servers OS on a Server Host, and we usally use remote application to manage the servers as they are usally not connected to input device or monitors


      My System SpecsSystem Spec

  3. #2
    IownAmoneyPit's Avatar

    Canadian Loonie X 2


    Join Date : Oct 2010
    Posts : 612
    Windows 8.1/Windows 10 TP Virtual Machine
    Canada ca alberta


    Excellent tutorial Kari , I am currently running Kubuntu 11.10 in Hyper V and hope microsoft adds more integration features like Virtual PC. I am going to try same guest in VMware next.

    Name:  KUB.jpg
Views: 56750
Size:  71.6 KB
    Last edited by IownAmoneyPit; 07 Apr 2012 at 04:42 AM.
      My System SpecsSystem Spec

  4. #3
    jimbo45's Avatar

    Senior Member



    Join Date : Sep 2011
    Hafnarfjörður IS
    Posts : 4,263
    Linux Mint KDE 16, W8.1, W7, W2K3 Server
    Iceland


    Thanks for the great tutorial
    Can't get Sound however on W7 - X64 or Suse 12.2 (64 bit) Guests even using RDP. I've checked all the settings - running HOST Windows 8 CP x-64

    I'll try RDP'ing from another Machine on a different LAN to see if there's any joy there either.

    Thanks again


    cheers
    jimbo
      My System SpecsSystem Spec

  5. #4
    Kari's Avatar

    Old geek, new tricks




    Join Date : Jul 2009
    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,186
    Windows 8.1 Pro with Media Center
    Finland de saxony


    Thanks Jimbo.

    Same here, sound OK on Windows guests over RDP, no sound on Linux guests. Still searching.

    Kari
      My System SpecsSystem Spec

  6. #5



    New Member

    Join Date : Jul 2013
    Posts : 1
    Windows 8.1


    This is great, thank you.
    I'm having a problem installing Ubuntu once I've turned off ACPI however, once this is done the Ubuntu installer sees the hard drive (VHD) as being too small. I set the virtual machine up to have a 10GB VHD so it expands dynamically right? If ACPI is left on, the installer works fine and detects the VHD as being 10GB. However if I turn off ACPI as instructed, once I get to the "Preparing to install Ubuntu" (Section 2.2.5 above) it has a cross for the HDD space and won't let me proceed with the installation. What is a solution to this? If I were to "force install" Ubuntu would the VHD automatically increase in size with ACPI turned off? If so, how does one "force install"? Or is there a better way to keep the VHD size once ACPI is turned off?
    Thanks in advance
      My System SpecsSystem Spec

  7. #6
    Kari's Avatar

    Old geek, new tricks




    Join Date : Jul 2009
    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,186
    Windows 8.1 Pro with Media Center
    Finland de saxony


    Hi Christaffer, welcome to the Eight Forums.

    As this tutorial was written almost year and a half ago, over half a year before Windows 8 was published, and as both the Hyper-V and Ubuntu have evolved since that, I must tell you I am not sure if the installation still requires ACPI being turned off. I use only SUSE distribution for my Linux needs and have not installed or used Ubuntu in Hyper-V since publishing this tutorial.

    I will do a test Ubuntu installation as soon as I have time for it to make necessary updates to this tutorial, please check back in a few days.

    In the mean time, let's make sure you have understood the concept of a dynamically expanding VHD correctly: the amount of storage space specified for a dynamically expanding VHD is the maximum file size allowed for it. For instance, if you specify the VHD to be 10 GB as you told, it means that if your Ubuntu installation needs let's say 6 GB you only have 4 GB left for your installed software and personal files, the vhd being unable to expand (grow) beyond the 10 GB limit you specified.

    In other words, the amount of storage space given to a dynamically expanding VHD is the maximun size it can expand to, not the "starting" size. In your case as you described it, your VHD could never grow to be bigger than 10 GB.

    Kari
      My System SpecsSystem Spec

  8. #7



    Member

    Join Date : Dec 2012
    Posts : 75
    Windows 8.1 64-bit


    @Kari
    Why do we have to use a network switch ? Cant we just install from an iso image or a dvd. Why is the network switch required ? In software's like VirtualBox we can just install from an image, is the Virtual network switch required for the installation the guest OS or do you just do it we can get Internet access from within the guest OS ?
      My System SpecsSystem Spec

  9. #8



    Junior Member

    Join Date : Nov 2013
    Posts : 3
    Windows 8.1

    What do I need to do to get this to work under 8.1 ?


    I used this thread to install a SUSE (12.1) VM on Windows 8.0. Worked like a dream (after a bit of futzing around with network config). But I then "upgraded" to Windows 8.1 and my VM ceased to work. reinstalling gives the same problem. It installs OK but when it starts it falls over at...

    Click image for larger version

    Pressing Y just produces this...
    Click image for larger version

    Any ideas ?

    The UBUNTU install (with 12.04.3) works ok. But it looks a lot more cumbersome than SUSE and I can't get networking going so I'd really like to get back to SUSE.

    BTW 8.1 also screwed up my Hamachi/Logmein setup and pissed on my Cygwin. Not impressed.
      My System SpecsSystem Spec

  10. #9



    Junior Member

    Join Date : Nov 2013
    Posts : 3
    Windows 8.1


    Still no luck with 8.1. So I ditched Hyper-V in favour of VMwarePlayer. Simpler and much more intuitive. I got a networked SUSE box up and running without any need consult diocumentation or go to Google for hints and gotchas. Mystery to me why anybody would use Hyper-V for this. Once again Microsoft shoots itself in the foot.
      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
Hyper-V – Create Linux Virtual Machine in Windows 8
Similar Threads
Tutorial Forum
Best Virtual Machine software to install Windows 8 DP? Virtualization
Virtual Machine Experiment Chillout Room
Virtual Machine Warning Virtualization
W2K3 virtual machine on W8 plays commercial DVD's now Virtualization
Eight Forums Android App Eight Forums IOS App Follow us on Facebook

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23