Skip to content

Commit e0f278f

Browse files
committed
Update a post: qemu-socket-vmnet.md
1 parent c60dd84 commit e0f278f

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

content/post/qemu-socket-vmnet.md

+35-5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ brew install socket_vmnet
3535
brew tap homebrew/services
3636
# sudo is necessary for the next line
3737
sudo brew services start socket_vmnet
38+
39+
# Export the environment variable
40+
export PATH="$(brew --prefix)/opt/socket_vmnet/bin:${PATH}"
3841
```
3942

4043
## Test
@@ -67,7 +70,7 @@ sudo brew services restart socket_vmnet
6770
3. Boot QEMU to install Ubuntu.
6871

6972
```shell
70-
socket_vmnet_client /opt/homebrew/var/run/socket_vmnet \
73+
socket_vmnet_client "$(brew --prefix)/var/run/socket_vmnet" \
7174
qemu-system-aarch64 \
7275
-machine virt,accel=hvf \
7376
-cpu host \
@@ -83,7 +86,7 @@ sudo brew services restart socket_vmnet
8386
# Boot Ubuntu in QEMU
8487

8588
```shell
86-
socket_vmnet_client /opt/homebrew/var/run/socket_vmnet \
89+
socket_vmnet_client "$(brew --prefix)/var/run/socket_vmnet" \
8790
qemu-system-aarch64 \
8891
-machine virt,accel=hvf \
8992
-cpu host \
@@ -97,6 +100,33 @@ socket_vmnet_client /opt/homebrew/var/run/socket_vmnet \
97100

98101
# Log into the server by SSH
99102

100-
```shell
101-
ssh 192.168.105.2
102-
```
103+
1. Get the name of the network device.
104+
105+
```shell
106+
$ ip link
107+
108+
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
109+
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
110+
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
111+
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
112+
```
113+
114+
We can see the name of the network device is `enp0s1`.
115+
116+
2. Get the IP address.
117+
118+
```shell
119+
$ ip route
120+
121+
default via 192.168.105.1 dev enp0s1 proto dhcp src 192.168.105.2 metric 100
122+
192.168.105.0/24 dev enp0s1 proto kernel scope link src 192.168.105.2 metric 100
123+
192.168.105.1 dev enp0s1 proto dhcp scope link src 192.168.105.2 metric 100
124+
```
125+
126+
We can see the IP address is `192.168.105.2`.
127+
128+
3. Log into the server
129+
130+
```shell
131+
ssh 192.168.105.2
132+
```

0 commit comments

Comments
 (0)