Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cloud-init to configure network #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use cloud-init to configure network
It might be better to use cloud-init config to set up the injected network. I couldn't work out how to use the `network:` section of cloud init, so have just put the required `dhclient` command into the `runcmd:` section.
  • Loading branch information
drpump authored Apr 1, 2022
commit 53bd8bae484efdda90843c9fc131574c28baf536
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ $ make hack
You can use Multipass as usual. The script `hyperkit.sh` will "inject" the network interface `virtio-vpnkit,path=/var/run/vpnkit.socket`.

```bash
# Start your VM
$ multipass launch --name ubuntu
# Start your VM with injected network configured
$ multipass launch --name ubuntu --cloud-init - <<EOF
runcmd:
- dhclient enp0s2f1
EOF

# Configure network
$ multipass exec ubuntu -- bash -c "sudo dhclient enp0s2f1"
cmp: EOF on /tmp/tmp.n9kuxd3EyQ which is empty

# Get ip
# Check ip
$ multipass exec ubuntu -- ifconfig enp0s2f1
enp0s2f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.66.5 netmask 255.255.255.0 broadcast 192.168.66.255
Expand Down