Skip to content

Run HypervisorUI on local machine

asxtree edited this page Nov 12, 2021 · 19 revisions

Run HypervisorUI on local machine

Table Of Content


Introduction

The hypervisorUI allows you to manage and monitor your skywire-visor nodes. These skywire-visor nodes run the Skywire protocol. They also host the applications that you can use over the Skywire network. The hypervisorUI facilitates and aggregates the management of the nodes into one user interface.

If you want to setup the hypervisorUI on your own machine, you need to run the following steps before you flash the images for your Skyminer. That will allow you to manage and monitor your nodes from everywhere. You will not be restricted to using the hypervisorUI only from within the local network that the Skyminer is in.

Installing the Hypervisor

To install the hypervisor and use the hypervisorUI, make sure you have Git and Golang installed on your machine. You need Golang version 1.16+ for go modules support. Start by downloading the latest version of Go for your OS and architecture on golang.org .

Open the terminal and use cd to enter the directory that you downloaded the Go binary to. Run

sudo tar -C /usr/local -xzf $GO_BINARY (replace $GO_BINARY with the name of the file you downloaded)

Enter the password for your machine and hit Enter.

Then add the Go installation to your $PATH with

export PATH=$PATH:/usr/local/go/bin 

You can test whether Go was succesfully installed with

go version

This command should return the version of Go you installed.

Next, you need to install Git. This can be done with

git --version (for MacOS users)

sudo apt install git-all(for users of Debian based Linux distributions)

You can now clone the skywire repo with:

git clone https://github.com/skycoin/skywire.git

Enter the directory with

cd skywire

Build and install by running

make build; make install

Afterwards you can generate a visor configuration exposing the hypervisorUI with:

skywire-cli config gen --is-hypervisor

Copy the Public Key of the hypervisor configuration file you just generated and input it into the Skyimager as described in the Skyimager User Guide.

Start the hypervisor with

skywire-visor -c skywire-config.json

Installing the Hypervisor on Windows 10

In order to run the hypervisor on Windows 10 we choose to take advantage of the available Linux Subsystem. Just follow the next steps to setup Ubuntu 18 Linux Subsystem and configure the hypervisor.

  1. Open Start, search for Powershell then do right click on the top result and select Run as administrator option.

NOTE that the following commands can be pasted directly in Powershell using the right click on the mouse.

  1. Type the following command to enable the Linux Subsystem:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  1. Save your work on the pc and confirm with Y and press Enter when asked to reboot.

  2. Now you need to download and install Ubuntu 18 Linux Subsystem so we'll create a folder on partition C:\ named Ubuntu18. Open again Powershell as administrator and type:

mkdir C:\Ubuntu18

cd C:\Ubuntu18

  1. Download Ubuntu 18 Linux Subsystem by executing the following command in Powershell.

Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile Ubuntu18.appx -UseBasicParsing

  1. Install Ubuntu 18 Linux Subsystem.

Add-AppxPackage .\Ubuntu18.appx

  1. Open Start and type Ubuntu and open the top result, this will open a command prompt like termial to your Linux Subsystem. Set your username when asked and the password, which needs to be written twice (the password will not be shown as you write it).

NOTICE: The next commands you can copy them and paste them into the terminal using the right click in the terminal.

  1. Create the appropriate folders:

sudo mkdir -p /var/skywire-visor

sudo mkdir -p /etc/skywire-visor

sudo mkdir -p /tmp/{bin,log,run}

  1. Download skywire-mainnet v0.4.2:

sudo wget -c https://github.com/skycoin/skywire/releases/download/v0.5.1/skywire-v0.5.1-linux-amd64.tar.gz -O /tmp/skywire.tar.gz

  1. Extract and move the extracted files:

sudo tar xvzf /tmp/skywire.tar.gz -C /tmp/bin

sudo cp -rf /tmp/bin/* /usr/bin/

  1. Generate the hypervisor config:

sudo /usr/bin/skywire-cli config gen -o /etc/skywire-config.json --is-hypervisor

  1. Download and enable the skywire service, Linux Subsystem does not support a systemd service so instead we made an init.d service just as efficient.

sudo wget -c https://raw.githubusercontent.com/asxtree/skywire-mainnet/asxtree-patch-1/static/skywire-manager-src/skywire.service -O /etc/init.d/skywire.service

Enable the service to run when we start the Linux Subsystem:

sudo chmod a+x /etc/init.d/skywire.service

sudo update-rc.d skywire.service defaults 97 03

First start and restart of the service:

sudo service skywire.service start && sudo service skywire.service restart

  1. If you want to connect your visors to the local installed hypervisor you need to get the public key of the hypervisor and add it in the visor config so using the following command it will print the skywire-hypervisor public key

cat /etc/skywire-config.json | grep "pk" | awk '{print substr($2,2,66)}'

  1. Open the web browser and go to http://localhost:8000

Accessing the HypervisorUI

In order to access the hypervisorUI, open a browser and go to https://localhost:8000.

access

When you access the UI the first time, click on Configure initial launch. You can now enter a password to restrict access to the UI from within the local network. If you forget the password, you will have to manually access the hypervisor node to gain access again.

Proxy Setup

skywire-visor allows you to setup proxy connections via remote visors to the Internet over the Skywire network. In order to setup a proxy connection, start by clicking on one of the visors that appear in your hypervisorUI. This will open up an overview page for the specific visor you chose.

visor list

Now click onto the + button next to the transport field. Input the PublicKey of the remote

visor and select dmsg as the transport type. This should setup a transport to a remote visor.

add tp

Next switch to the Apps tab of the UI and click on the gear icon next to the skysocks-client application and input the PublicKey of the remote visor again. Afterwards, start the skysocks-client by clicking on the triangle next to skysocks-client .

skysocks client

The proxy connection should now be succesfully setup. You can use the proxy by configuring your browser to use the connection exposed on localhost:1080.

Clone this wiki locally