Skip to content

Commit 2a24cce

Browse files
committed
env/darwin/aws: switch to vmnet-shared networking
This networking mode, which uses a virtualization networking API from Apple, appears to be more stable than the default userspace networking. Multiple guests will share the same subnet, so they must have different MAC addresses. Apple's API seems to run an DNS server that serves compressed SRV records, which Go does not support (golang/go#36718) and thus causes a net test to fail. Until that is resolved, we must manually specify a custom DNS server. For golang/go#48945. Updates golang/go#36718. Change-Id: Ibc5b91ed1456d1364975febe83fd282c42bd6ed1 Reviewed-on: https://go-review.googlesource.com/c/build/+/442255 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Jenny Rakoczy <[email protected]> Run-TryBot: Michael Pratt <[email protected]>
1 parent 51d7d4d commit 2a24cce

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

env/darwin/aws/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ configure it to autoboot to macOS.
126126
$ $HOME/start-mutable.sh macos-monterey.qcow2 $OSK_VALUE
127127
```
128128

129-
Now complete the remainder of the [machine setup](../setup-notes.md). See the
130-
`hostfwd` option in `qemu.sh` if you would like SSH access to the guest.
129+
Now complete the remainder of the [machine setup](../setup-notes.md). For SSH
130+
access, the guest should be reachable at 192.168.1.2 or 192.168.1.3 from the
131+
host machine.
131132

132133
Copy complete images to `s3://go-builder-data/darwin/` for use on other
133134
builders.

env/darwin/aws/qemu.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ args=(
3535
-device ich9-ahci,id=sata
3636
-drive id=MacHDD,if=none,format=qcow2,file="$DISK"
3737
-device ide-hd,bus=sata.2,drive=MacHDD
38-
-netdev user,id=net0 # add ,hostfwd=tcp::5555-:22 to forward SSH to localhost:5555.
39-
-device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27 # for macOS >= 11
40-
# -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 # for macOS < 11
38+
-netdev vmnet-shared,id=net0
39+
-device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:0$PORT # for macOS >= 11
40+
# -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:0$PORT # for macOS < 11
4141
-monitor stdio
4242
-device VGA,vgamem_mb=128
4343
-M accel=hvf
4444
-display vnc=127.0.0.1:"$PORT"
4545
)
4646

47-
DYLD_LIBRARY_PATH="$HOME/sysroot-macos-x86_64/lib" "$HOME/sysroot-macos-x86_64/bin/qemu-system-x86_64" "${args[@]}" ${EXTRA_ARGS:+$EXTRA_ARGS}
47+
sudo env DYLD_LIBRARY_PATH="$HOME/sysroot-macos-x86_64/lib" "$HOME/sysroot-macos-x86_64/bin/qemu-system-x86_64" "${args[@]}" ${EXTRA_ARGS:+$EXTRA_ARGS}

env/darwin/setup-notes.md

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ In System Preferences:
107107
- Sharing > enable ssh (leave the default administrators setting)
108108
- Users & Groups > Gopher Gopherson > Login Items > add run-builder
109109
- Users & Groups > Login Options > auto-login Gopher Gopherson
110+
- Network -> Ethernet -> Advanced -> DNS -> Add DNS server -> 8.8.8.8
111+
- Only necessary on AWS guests, and until https://go.dev/issue/36718 is
112+
resolved on all tested releases.
110113
111114
Install XCode:
112115
- Download Xcode from the Apple Developer site:

0 commit comments

Comments
 (0)