Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Exchanging files between virtual machine and host

  1. #1

    Default Exchanging files between virtual machine and host

    Hi folks,

    Just created a virtual machine using the XEN virtualization software (using vminstall) in order to have a script tested.

    Unfortunately I haven't figured out how to transfer files between the host and the virtual machine. How can I make the 2 file systems communicate locally without using any (external) internet connection? It would be rather inefficient to use Dropbox for example.

    I would appreciate any ideas that could help me solve this issue.

    Thanks in advance for your support!

    Regards,
    Liviu

  2. #2

    Default Re: Exchanging files between virtual machine and host

    What are the OS's involved? If Linux, you can use SSH (Secure CoPy, so
    SCP) out of the box assuming you have enabled SSH on the side you want to
    be the server (both sides if you want to have either side be the server on
    a case-by-case basis). The nice thing there is that if our clients side
    is Linux there are built-in graphical ways to access the server
    (Konqueror, Firefox I think, etc.) or command line options.

    If the file server (in a client/server model) is ever windows,, setting up
    Samba for SMB-based transfers works well enough.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Exchanging files between virtual machine and host

    On 2014-04-13 21:06, Liviu82 wrote:

    > Unfortunately I haven't figured out how to transfer files between the
    > host and the virtual machine. How can I make the 2 file systems
    > communicate locally without using any (external) internet connection? It
    > would be rather inefficient to use Dropbox for example.


    Why external? Why not internal?

    You communicate between host and guest same as you would connect any two
    machines inside your lab, office, or home. You can share directories
    using NFS or Samba (the Windows way), or using an FTP server, or an HTTP
    server, or via SSH.

    Whatever you prefer.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Exchanging files between virtual machine and host

    The universal implementation in practically all virtualization technologies is to implement the Plan 9 protocol.

    Interesting that I can't Google a set of instructions how to setup in Xen.
    Maybe you (or someone else) can find something, I'd be <very> surprised if Xen doesn't support creating a mount point specifying the Plan 9 protocol from within the Guest. But, to do so also requires the ability to expose the shared directory first on the Host, and although similar the exact command to do so varies a little bit from one virtualization technology to another.

    I wouldn't be surprised at all if you tried the instructions to setup a Shared Folder using the SDB KVM instructions, <maybe> it might work in Xen, too.

    My Google hits do suggest that Plan 9 protocol support was added in 2008, but I don't see anything after that.
    Maybe you'll have better luck searching.

    HTH,
    TSU

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Exchanging files between virtual machine and host

    I forgot I had posted this awhile back
    http://en.opensuse.org/User:Tsu2/virtfs#Overview

    If you install the libvirt packages, IMO should work for XEN the same way it works in KVM or any other virtualization technology.

    Asking you to post back here if it really does work for you.

    TSU

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Exchanging files between virtual machine and host

    BTW -
    As an alternative, although I don't think it's what you're asking for but within the parameters of your original post,

    You can set up a Host Only network and implement ordinary network connections and network shares. Because you'd be doing this on a Host Only network, the packets are never seen on the real physical network.

    TSU

  7. #7

    Default Re: Exchanging files between virtual machine and host

    Thank you folks for your answers. Indeed I forgot to mention that the guest OS is Opensuse 13.1 (same as host) as I need to get a script tested before it will be run on the host (otherwise it would get messy on the host OS).

    I will update you regarding the "result".

    Have a great day further!

  8. #8

    Default Re: Exchanging files between virtual machine and host

    Quote Originally Posted by tsu2 View Post
    I forgot I had posted this awhile back
    http://en.opensuse.org/User:Tsu2/virtfs#Overview

    If you install the libvirt packages, IMO should work for XEN the same way it works in KVM or any other virtualization technology.

    Asking you to post back here if it really does work for you.

    TSU
    Tried this, however it doesn't work for XEN. It says it is not supported for this hypervisor/libvirt combination (referring to XEN).

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Exchanging files between virtual machine and host

    Quote Originally Posted by Liviu82 View Post
    Tried this, however it doesn't work for XEN. It says it is not supported for this hypervisor/libvirt combination (referring to XEN).
    I see 9p support may be in a "discussion" phase...
    http://wiki.xen.org/wiki/GSoc_2014#E...aravirt_device

    I guess Xen is the libvirt outlier, possibly because unlike the other virtualization technologies which simply modify extensions to the kernel, Xen is its own kernel with a modified kernel base (AFAIK).

    So, I guess you're left with the other options I desceibed (unless someone who is a frequent Xen user might suggest otherwise).

    Recommend setting up a virtual network that's not a part of your main network if you want to keep the network bits off the wire... and on this Host Only network, configure ordinary network shares.

    TSU

  10. #10

    Default Re: Exchanging files between virtual machine and host

    Found the solution to the issue. I installed VirtualBox and created a virtual machine which I connected to the host using the host-only network. Then I made the setup of ssh as follows:
    - host as server (sshd configured using sshd_config)
    - VM as guest (created a config file in the .ssh folder located in the home directory of the user)

    Both SSH and SCP work just fine.

    In addition to this I am very satisfied of how VBOX displays the output (it is perfectly scaled as if I worked directly with a physical machine). Sometimes I confuse the output of the VM with the output of the host

    So as a conclusion: problem solved!

    If anyone is interested in more details I can gladly help.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •