@@ -40,6 +40,46 @@ networks:
4040
4141An instance's IP address is resolvable from another instance as ` lima-<NAME>.internal.` (e.g., `lima-default.internal.`).
4242
43- _Note_
43+ > **Note**
44+ >
45+ > Enabling user-v2 network will disable the [default user-mode network]({{< ref "/docs/config/network/user" >}}).
4446
45- - Enabling this network will disable the [default user-mode network]({{< ref "/docs/config/network/user" >}})
47+ # # Accessing VMs from the host
48+
49+ By default, the `lima-<NAME>.internal` hostnames are only resolvable from within the guest VMs.
50+ To access the guest network from the host, use `limactl tunnel` to create a SOCKS proxy :
51+
52+ ` ` ` bash
53+ limactl tunnel <INSTANCE>
54+ ` ` `
55+
56+ The command will output the proxy address (the port is randomly assigned) :
57+ ` ` ` console
58+ $ limactl tunnel default
59+ Set ` ALL_PROXY=socks5h://127.0.0.1:<PORT>`, etc.
60+ The instance can be connected from the host as <http://lima-default.internal> via a web browser.
61+ ```
62+
63+ You can then access any VM on the user-v2 network from the host using the SOCKS proxy:
64+
65+ {{< tabpane text=true >}}
66+ {{% tab header="curl" %}}
67+ ``` bash
68+ curl --proxy socks5h://127.0.0.1:< PORT> http://lima-default.internal
69+ ```
70+ {{% /tab %}}
71+ {{% tab header="Environment variable" %}}
72+ ``` bash
73+ export ALL_PROXY=socks5h://127.0.0.1:< PORT>
74+ curl http://lima-default.internal
75+ ```
76+ {{% /tab %}}
77+ {{% tab header="Web browser" %}}
78+ Configure your browser to use the SOCKS5 proxy at ` 127.0.0.1:<PORT> ` ,
79+ then navigate to ` http://lima-default.internal ` .
80+ {{% /tab %}}
81+ {{< /tabpane >}}
82+
83+ > ** Note**
84+ >
85+ > ` limactl tunnel ` is experimental.
0 commit comments