Issue
I'm having a hard time finding a solution to access my Linux guest system running on QEMU from my macOS Big Sur host.
The only solution I've found that works is port forwarding (using e.g. -net user,hostfwd=tcp::2200-:22
for SSH). This works, but is not convenient since I need to forward all the ports I need to use, and I would like to be able to use scripts, applications, etc. without having to tweak the ports everywhere.
So having an IP to connect from the host to the guest would be best, but surprisingly I couldn't find an easy to do so.
Solution
The only articles I found online related to this seem to be valid only for older versions of macOS.
Looks like newer versions of macOS have a new mechanism for this, called vmnet.
And a patch for QEMU was implemented recently: https://gitlab.com/qemu-project/qemu/-/issues/465
With this patch, using -nic vmnet-host
makes the guest accessible from the host (on an interface called bridge100
).
At the moment, the latest stable release of QEMU (7.0.0) doesn't include this patch, but it's possible with brew to build the latest HEAD from git, which includes this change (but can't be considered stable!), using brew install qemu --HEAD
.
Afterwards, make sure to use the correct qemu binary, by updating your PATH env variable or executing the binary with full path directly. Should be something like this: /usr/local/Cellar/qemu/HEAD-7077fcb/bin/
Answered By - Arnaud
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.