[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 10.0.2.2.

If, for example, you're running a web server locally on the host, the guest can `curl http://10.0.2.2/`. 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" http://10.0.2.2/` (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=:127.0.0.1:12345-:22; then use ssh username@127.0.0.1 -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@127.0.0.1:.

sshfs -p 12345 root@127.0.0.1:/ local-mountpoint

And/or sshfs with another user in order to be creating/editing guest files as that user instead.
From:
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.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

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.

Profile

idupree

January 2014

S M T W T F S
   1234
567891011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

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