LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > Bits and Pixels
User Name
Password

Notices

Concerning free software, programming, and whatever else I find interesting. Also the blog for my Web site, frigidcode.com.
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:

Code:
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:

Code:
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 844 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 11:06 AM.

Main Menu

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