[personal profile] idupree
(The canonical location of this blog post is now QEMU networking notes on my web site.)

The default network settings allow the guest to connect to the Internet (via TCP and UDP but not e.g. ICMP/ping), and to the host at

If, for example, you're running a web server locally on the host, the guest can `curl`. A local firewall won't necessarily prevent this because QEMU makes the guest's network request from your computer and your user account. If your web server has rewrite rules based on the HTTP Host header, try changing Host using `curl -H "Host: localhost"` (use -v/--verbose to make curl show request and response headers).

Networking can be completely disabled by passing qemu -net none.

hostfwd= can be used to let the host (and possibly other machines on the host's network) connect to the guest; see the man page for details. The following lets me ssh from the host to the guest (provided I've installed and enabled an ssh server on the guest): -net nic -net user,hostfwd=:; then use ssh username@ -p 12345. Adding restrict=y to the -net option group disables guest access to the host and internet. It claims to still allow hostfwd/guestfwd options to work, but I haven't found out how to make that work yet.

More SSH variations (the latter uses sshfs):

scp [-r] -P 12345 some-file username@

sshfs -p 12345 root@ local-mountpoint

And/or sshfs with another user in order to be creating/editing guest files as that user instead.
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.



January 2014


Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 22nd, 2017 04:58 am
Powered by Dreamwidth Studios