In Japan, the season of thesis defense is coming closer and closer. I have to switch my working environment from native Ubuntu to Windows to get Microsoft Words to work on my thesis. Yesterday I had a chance to install Windows 8.1 with a university license, so I wanted to give a shot trying out Hyper-V for the first time. You might not hear about it before. Since most of the time in a college, lecturers usually recommend to use something free, such as, VirtualBox and QEMU. This Hyper-V is the same thing. It is a kind of Virtual Machine (VM) manager.
Here I played with it by setting up an Arch Linux 64-bit virtual machine under Hyper-V on a Windows 8.1 host. I could install and run Arch Linux + cdm + i3wm inside Hyper-V with no problem. So far, I found only one issue that I cannot use a clipboard between host and slave machines i.e. no Ctrl+C/V.
In this series I am going through the process I did in order to get Arch Linux works inside Hyper-V. This post talks about setting up a VM in Hyper-V and provide it Internet connection.
Wake Hyper-V up from slumber
According to Hyper-V Wikipedia, Hyper-V is shipped with Windows Server 2008+ and Windows 8+. If you are using Windows 8+, but you cannot find Hyper-V in your machine. You can turn this Windows Features on by
- Go to Control panel > Programs > Programs and Features
- Click Turn Windows Features on or off
- Check Hyper-V and click Ok
This gives you 2 essential programs:
- Hyper-V Manager – Control Center of all Hyper-V VM.
- Hyper-V Virtual Machine Connection – Get graphic output from a Hyper-V VM.
Create a Virtual Machine
Before creating a VM, I downloaded Arch Linux ISO beforehand. I like to have a wizard to do a job instead of configuring by myself later.
You can follow the creation process in the following slide.
Provide Internet via Internet Sharing
Arch Linux is a rolling release distro. This word has been spread all over places where Arch Linux fellows live. I don’t know what does it means, but in short it requires an internet connection to get a job done.
Setting up an Internet connection for VM adds one more step for preparing a VM environment compared to VirtualBox which provides NAT configuration by default.
There are 2 ways easy ways to do this:
- Share Internet connection from another interface
- Bridge physical interface and virtual interface together
I went for the first method, because it provides isolation of a VM with an outside world. The hierarchy for this connection is as the diagram below.
In the previous creation process, I connect the VM to a virtual internal network switch named “Windows Phone Emulator Internal Switch”. If your wizard does not show up any network interface during the wizard, you can create one by followings:
- Go to Virtual Switch Manager
- Create new virtual network switch
- Check Internal network
Now your network connection window should show your new virtual network interface along with other physical interfaces.
Now let’s share Internet to our virtual interface.
- Right click your network interface which has Internet connection > Properties
- Go to Sharing tab
- Check allow other network users to connect through this
- Select your virtual interface if a drop down list is available
- Click ok
Your host machine is virtually connected to a virtual switch which your VM is also connected. This is the door for your VM to reach the outside world through your host machine. As they are connected to the same (virtual) switch, they require proper IPs to be on the same network. Both of them need configuration. Automatic IP resolving is not that smart, so I create a static IP address for host. When we turn on the VM next time, its resolver can figure out in no time. I set host’s IP address as:
- IP: 192.168.46.1
- Subnet: 255.255.255.0
- Default Gateway: Blank
- DNS: 192.168.46.1
That’s all for this post. In the next post, I will guide how to install Arch Linux in a VM.