How can I share files between an OpenVZ container and its hosts?

Posted on 2014-08-12
Last Modified: 2014-09-04
I am running OpenVZ containers on a Proxmox/ Debian host.

There are some files (eg, /etc/resolv.conf) I'd like the container to use directly from the host.

So, is there some smart way to have /etc/resolv.conf on the container linked to /etc/resolv.conf on the host?

File /etc/resolv.conf on container 100 is also visible on the host as /var/lib/vz/private/100/etc/resolv.conf and /var/lib/vz/root/100/etc/resolv.conf (BTW, is there a difference?)
Question by:fibo
    LVL 19

    Accepted Solution

    I believe the following link is what you are looking and list how to mount a host file system on the guest..
    LVL 29

    Author Comment

    Excellent page.
    Not exactly what I am looking for though: I want to link to a given file, not a complete directory.
    LVL 29

    Assisted Solution

    Results so far:
    -impossible to have a "live link" to a single file, but possible at the directory level
    - in the case of the ..root directory: at boot-time it is copied into the ...private directory

    Closing the question
    LVL 29

    Author Closing Comment

    Excellent and fast answer, although not completely matchjng my question

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Citrix XenDesktop 7.6 Citrix Policies Graphics
    VMware Update Manager(VUM) “error code: 15” during ESXi 6.0 Remediate update in VUM operation
    How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
    In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now