April 21, 2024

Installing the io.net workers on VPS

1. Launch the terminal (I use MobaXterm). Go to Sessions → New session

2. SSH → enter the IP of the server in the Remote host field → click the check mark next to Specify username → enter root → OK

3. Accept

4. Enter the password that we saved. It will not be visible, but it is entered

5. Copy all the following commands with the Copy button, insert them into the terminal with the right mouse button and press Enter

6. Enter commands in the terminal:

sudo -s
sudo apt update && sudo apt upgrade -y

7. After it is almost loaded, use the arrows to select the first line and press Enter

8. Wait for it to load until the end, after which we enter the commands:

sudo apt update
sudo apt install -y libvirt-clients
sudo virt-host-validate
sudo update-grub
sudo reboot

9. After the last command, you will have:

Press R and log in again

10. Next, enter the commands:

sudo apt install -y qemu-kvm \
                      libvirt-daemon-system \
                      bridge-utils \
                      virtinst
sudo systemctl status libvirtd

After this command, press Ctrl + C and continue:

sudo apt install -y cloud-image-utils
sudo usermod -aG kvm $USER
sudo usermod -aG libvirt $USER
mkdir -p /new/path/kvm/base
wget -P /new/path/kvm/base https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img
sudo mkdir -p /new/path/kvm/vm01
qemu-img create -F qcow2 -b /new/path/kvm/base/focal-server-cloudimg-amd64.img -f qcow2 /new/path/kvm/vm01/vm01.qcow2 30G
export MAC_ADDR=$(printf '52:54:00:%02x:%02x:%02x' $((RANDOM%256)) $((RANDOM%256)) $((RANDOM%256)))
export INTERFACE=eth001
export IP_ADDR=192.168.122.101
cat >network-config <<EOF
ethernets:
    $INTERFACE:
        addresses: 
        - $IP_ADDR/24
        dhcp4: false
        gateway4: 192.168.122.1
        match:
            macaddress: $MAC_ADDR
        nameservers:
            addresses: 
            - 1.1.1.1
            - 8.8.8.8
        set-name: $INTERFACE
version: 2
EOF
cat >user-data <<EOF
#cloud-config
hostname: vm01
manage_etc_hosts: true
users:
  - name: vmadm
    sudo: ALL=(ALL) NOPASSWD:ALL
    groups: users, admin
    home: /home/vmadm
    shell: /bin/bash
    lock_passwd: false
ssh_pwauth: true
disable_root: false
chpasswd:
  list: |
    vmadm:vmadm
  expire: false
EOF
touch meta-data
cloud-localds -v --network-config=network-config /new/path/kvm/vm01/vm01-seed.qcow2 user-data meta-data
virt-install --connect qemu:///system --virt-type kvm --name vm01 --ram 2048 --vcpus=2 --os-type linux --os-variant ubuntu20.04 --disk path=/new/path/kvm/vm01/vm01.qcow2,device=disk --disk path=/new/path/kvm/vm01/vm01-seed.qcow2,device=disk --import --network network=default,model=virtio,mac=$MAC_ADDR --noautoconsole
virsh list
virsh shutdown vm01

After the last command, we wait a few minutes

11. Continue:

virsh list --all

If it shows that vm01 is on, go back to point 19. If it is off, go to the next point. Example of disabled:

12. And again:

virsh dumpxml vm01 > vm01.xml
sed -i 's|<cpu mode='"'"'host-model'"'"' check='"'"'partial'"'"'/>|<cpu mode='"'"'custom'"'"' match='"'"'exact'"'"'>\n    <model fallback='"'"'allow'"'"'>qemu64</model>\n</cpu>|g' vm01.xml
virsh define vm01.xml
virsh start vm01
virsh console vm01

13. Enter the login: vmadm

The password is the same: vmadm

14. Without closing the terminal, go to site - https://cloud.io.net/login?redirect=/ and log in

15. Click on Cloud → Worker

16. Click Connect New Device

17. Choose as in the screenshot and enter your nickname:

18. Copy the first command → paste it into the terminal. Copy the second → command to the terminal

19. We do the same, in order, with these commands:

If you have a problem with text display when entering commands and the terminal is stuck, type clear and try again

20. After entering all the commands, wait 5 minutes and click on Refresh until it says that your device is connected

If after Refresh, it still does not see your worker, check with the command:

docker ps

If it displays two of your containers, then everything is ok. As long as they work, everything is fine, try to hit Refresh again after 30 minutes. If you still don't see the worker - contact support in the discord, they will help you there

In the Earning Rewards section, also link your Solana wallet

Thank you for reading to the end. This is done for the thread (https://x.com/Aleksan65412762/status/1782036467872670034) and for the io.net community <3