Every once in a while, while using VMWare Workstation, I am unable to connect to the network. After trying to restart adapters and manually entering IP information, the VM still would not connect. Specifically, the issue happened when using bridged networking so that I could get a direct IP instead of sharing a connection with the host. To fix this, I ran these commands on my host:
net stop vmnetbridge
net start vmnetbridge
This is the virualization platform I installed on my Macbook to create VMs.
I decided to set up a VM on my macbook. To do this, I installed UTM then created a VM using an Alpine Linux ISO. During the setup, I initialized eth0 for the network instead of bridge. It then used DHCP to obtain it’s own IP. Once I completed the setup, I rebooted the VM which reset everything and required alpine to be setup again. After several failed attempts, I resolved the issue by finishing setup, shutting down the VM, then deleting the ISO. Turns out, it was booting from the ISO every time.
Once set up, I noticed alpine worked a little differently than I was used to. When I tried to install nano with apk add nano, it said access denied so I tried sudo which didn’t exist. Instead of installing sudo I used the su command to switch to the root user. Then I was allowed to run elevated commands like apk add.
Another issue I encountered was being unable to install Docker. When I tried apk add docker it said it could not be found. When looking in the documentation, I learned that docker is in the community apk repo so I ran cat /etc/apk/repositories .
This showed that the community repo was being ignored (it started with '#'). I tried editing this file with setup-apkrepos, but the changes would not save. Finally, I edited with nano which actually saved the changes and allowed me to successfully update/upgrade apk and add docker. Once docker was added, I needed to set it up so that it would start during system boot:
rc-update add docker boot
The docker daemon can be manually started with
service docker start
I also needed to install docker compse:
apk add docker-compose
When I tried to start my containers for rustdesk, I got the error:
yaml: line 2: found character that cannot start any token
When I created the docker-compose.yml, I used tabs but I needed to use only spaces. Once I made that change, I was able to start the containers.
After I verified docker was working, I then set out to enable non-root users for docker because running as the root user can be dangerous. I verified that the docker group was created by viewing the /etc/group file. Then I added my non-root user to that group:
addgroup <username> docker
After switching user, I tried starting docker containers again and it worked!