Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active April 15, 2021 14:49
Show Gist options
  • Save gbraad/f6732b79d4a51255b2b4eaa055339583 to your computer and use it in GitHub Desktop.
Save gbraad/f6732b79d4a51255b2b4eaa055339583 to your computer and use it in GitHub Desktop.
Minishift on Qemu with Windows Hypervisor Platform accelerator support

Minishift on Qemu with Windows Hypervisor Platform accelerator support

Requirements

Windows 10 (updated after april 2018) with Hyper-V enabled. Download the Qemu binary from https://shadycode.com/qemu-binaries-for-windows-64-bit-with-hyper-v-and-haxm-support/ Note: build instructions are here: https://shadycode.com/how-to-build-qemu-with-hyper-v-acceleration-msys2/

Usage

Administrator command prompt

C:\>qemu-system-x86_64.exe -smp 2 -m 4096 -cdrom minishift-centos7.iso -display sdl -machine q35 -accel whpx -net nic -net user,hostfwd=tcp::10022-:22
Windows Hypervisor Platform accelerator is operational

Login using root/centos:

C:\>ssh root@localhost -p 10022
The authenticity of host '[localhost]:10022 ([127.0.0.1]:10022)' can't be established.
ECDSA key fingerprint is SHA256:u6D3acmCLTvJPxZkGN/yeEpL14r1lrEY+BSotymAJ90.
Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added '[localhost]:10022' (ECDSA) to the list of known hosts.
root@localhost's password:
[root@localhost ~]# ip a show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global noprefixroute dynamic eth0
       valid_lft 86126sec preferred_lft 86126sec
    inet6 fec0::5054:ff:fe12:3456/64 scope site mngtmpaddr dynamic
       valid_lft 86127sec preferred_lft 14127sec
    inet6 fe80::5054:ff:fe12:3456/64 scope link
       valid_lft forever preferred_lft forever

You could target this VM with minishift --vm-driver generic. Note: generate keys with ssh-keygen.

@gbraad
Copy link
Author

gbraad commented Apr 15, 2021

The releases at https://qemu.weilnetz.de/w64/ actually support -accel whpx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment