Skip to content

Commit

Permalink
ssh commands for internet access & dns resolution
Browse files Browse the repository at this point in the history
wait 2s for microVM to be up and then run ssh commands
on the host to setup internet access and DNS resolution in the guest

Signed-off-by: Himanshu Neema <[email protected]>
  • Loading branch information
64bit authored and pb8o committed Mar 19, 2024
1 parent e1ee954 commit a95627d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,19 @@ curl -X PUT --unix-socket "${API_SOCKET}" \

# API requests are handled asynchronously, it is important the microVM has been
# started before we attempt to SSH into it.
sleep 0.015s
sleep 2s

# Setup internet access in the guest
ssh -i ./ubuntu-22.04.id_rsa [email protected] "ip route add default via 172.16.0.1 dev eth0"

# Setup DNS resolution in the guest
ssh -i ./ubuntu-22.04.id_rsa [email protected] "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"

# SSH into the microVM
ssh -i ./ubuntu-22.04.id_rsa [email protected]

# Use `root` for both the login and password.
# Run `reboot` to exit.
#
# For internet access in the guest, run `ip route add default via 172.16.0.1 dev eth0`
# For DNS resolution in the guest, run `echo "nameserver 8.8.8.8" > /etc/resolv.conf`
```

Issuing a `reboot` command inside the guest will gracefully shutdown
Expand Down

0 comments on commit a95627d

Please sign in to comment.