You are not logged in.

#1 2015-01-21 15:58:21

sant527
Member
Registered: 2009-06-21
Posts: 273

[solved] systemd-nspawn how to acces files from the host

I have created a container called Mycontainer and installed the base using "pacstrap -i -c -d ~/MyContainer base"

Now i run "systemd-nspawn -bD ~/MyContainer" and login using root.


How to access the folder on my host. eg:/home/user/myfolder

Last edited by sant527 (2015-01-21 16:35:40)

Offline

#2 2015-01-21 16:02:56

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [solved] systemd-nspawn how to acces files from the host

Isn't systemd-nspawn a chroot and don't you typically use chroots to isolate parts of the system from each other? It really needs some more explanation as to why you would want to do this.

The only way I can think of quickly is setting up some sort of network share using NFS, SAMBA or maybe sshfs.

Offline

#3 2015-01-21 16:18:53

sant527
Member
Registered: 2009-06-21
Posts: 273

Re: [solved] systemd-nspawn how to acces files from the host

ANy easy way to access the host files from the container instead of NFS, samba etc. Like in sun virtualbox i can share a folder between host and guest.

Offline

#4 2015-01-21 16:24:16

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [solved] systemd-nspawn how to acces files from the host

Did you look at the man page of systemd-nspawnd? There is an option to bind mount a directory/file into the container.

Last edited by runical (2015-01-21 16:32:28)

Offline

#5 2015-01-21 16:35:16

sant527
Member
Registered: 2009-06-21
Posts: 273

Re: [solved] systemd-nspawn how to acces files from the host

thank you. Thats what i was looking.

Offline

Board footer

Powered by FluxBB