Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 4836789

Browse files
Add workaround for network access to LS from VM
1 parent b6656fa commit 4836789

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

content/en/user-guide/aws/ec2/index.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ The execution log is generated at `/var/log/cloud-init-output.log` in the contai
265265
### Networking
266266

267267
{{< callout "note" >}}
268-
Network access to EC2 instance is not possible on macOS.
268+
Network access from host to EC2 instance containers is not possible on macOS.
269269
This is because Docker Desktop on macOS does not expose the bridge network to the host system.
270270
See [Docker Desktop Known Limitations](https://docs.docker.com/desktop/networking/#known-limitations).
271271
{{< /callout >}}
@@ -545,6 +545,29 @@ You can then use a compatible VNC client (e.g. [TigerVNC](https://tigervnc.org/)
545545
Currently all instances are behind a NAT network.
546546
Instances can access the internet but are inaccessible from the host machine.
547547

548+
It is possible to allow network access to the LocalStack container from within the virtualised instance.
549+
This is done by configuring the Docker daemon to use the KVM network.
550+
Use the following configuration at `/etc/docker/daemon.json` on the host machine:
551+
552+
```json
553+
{
554+
"bridge": "virbr0",
555+
"iptables": false
556+
}
557+
```
558+
559+
Then restart the Docker daemon:
560+
561+
{{< command >}}
562+
$ sudo systemctl restart docker
563+
{{< /command >}}
564+
565+
You can now start the LocalStack container, obtain its IP address and use it from the virtualised instance.
566+
567+
{{< command >}}
568+
$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' localstack_main
569+
{{< /command >}}
570+
548571
### Elastic Block Stores
549572

550573
LocalStack clones the AMI into an EBS volume when the instance is initialised.

0 commit comments

Comments
 (0)