mysteriumnetwork / hyperv-myst-provision

Provisioning and distributing tools for HyperV Guest VM with myst exit node
0 stars 2 forks source link

Dual-mode dVPN (windows) - setup pipeline to automate distribution releases. Investigate hyperV in hyperV options. #5

Closed mdomasevicius closed 2 years ago

Guillembonet commented 3 years ago

hyper-v in hyper-v is possible, but the machines in GitHub actions do not support it ( https://github.com/actions/virtual-environments/issues/183 ). I also tried enabling the hyper-v feature in the action but it also does not work as a restart would be required but it is not possible.

Zensey commented 3 years ago

Another approach is to mount VHD's root fs in Linux, and do all commands inside jail. Will try to check if it works.

Zensey commented 3 years ago

It works. I was able to run shell, programs, network also works.

sudo guestmount -a /media/zensey/3096EB5796EB1BDA/Users/user/Downloads/Myst.HyperV.Alpine-0.67.3\ —\ копия/Myst\ HyperV\ Alpine/Virtual\ Hard\ Disks/Myset\ HyperV\ Alpine.vhdx -m /dev/sda3 /mnt/vhd2
sudo mount --bind /dev /mnt/vhd2/dev
cp -Lf /etc/resolv.conf /mnt/vhd2/etc/
sudo chroot /mnt/vhd2 /bin/bash
Zensey commented 3 years ago

Also I found out that QEMU image can be converted into VHDX image, so image build can be built from scratch using automation. For example we can boot QEMU with serial console and interact with VM using expect script.

Zensey commented 3 years ago

QEMU approach works. See https://github.com/mysteriumnetwork/hyperv-myst-provision/pull/13

Zensey commented 3 years ago

@mdomasevicius Can it be closed?