Download your favorite Linux distribution at LQ ISO.
Go Back > Blogs > Bits and Pixels
User Name


Concerning free software, programming, and whatever else I find interesting. Also the blog for my Web site,
Rate this Entry

sharing files with a qemu guest: the easier way

Posted 05-22-2012 at 03:32 PM by hydraMax

This will not be news to any true qemu guru. But for the rest of us: if you search online for information about how to share files with a qemu guest, you are likely to get pointed to some deep tutorial about setting up a TUN/TAP interface involving multiple configuration files and changes to your system permissions. A simpler approach is the -redir option:

qemu-kvm -hda debian.img -m 512 -redir tcp:5555:22
(The -m option refers to the amount of memory to allocate to the guest.)

The above invocation of the redir option will cause host traffic directed to port 5555 to be redirected to port 22 on the guest VM. So, after you boot up the guest, start up an SSH daemon from within the guest, and then you can connect to the guest from the host using scp or sftp over port 5555 on localhost. In my case I use sshfs:

sshfs me@localhost:/home/me /remote/cmhoward/guests/vdebian-i386 -p 5555
Where /home/me is a directory on the guest VM, and /remote/cmhoward/guests/vdebian-i386 is the place on the host where I want to mount the files.
Posted in Uncategorized
Views 1686 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 03:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration