Friends
I have got myself tied in knots trying to share a directory between the host and an Incus container.
I see at Type: disk - Incus documentation
Path on the host
You can share a path on your host (either a file system or a block device) to your instance by adding it as a disk device with the host path as the source: incus config device add <instance_name> <device_name> disk source=<path_on_host> [path=<path_in_instance>]
The path is required for file systems, but not for block devices.
What is <device_name>
in this instance? Is this the correct way to go? Am I off track?
I tried, given my container named c1
cd /tmp
mkdir c1_x
I want to share the directory /tmp/c1_x
incus storage create bar dir source=/tmp/poa_x
incus config device add c1 bar disk source=/tmp/c1_x path=/tmp/c1_x
But I clearly do not know what I am doing
Edit to add:
I found Use shift(fs) in Incus · toby63/shiftfs-dkms Wiki · GitHub That looks exactly like what I want, but bing a beginner with containers I cannot understand the instructions:
You only need to add this key to your device-configuration in the container/profile-config:
shift: true
For example:
folder1:
path: /home/user1/folder1
source: /home/hostuser1/folder1
shift: true
type: disk
If all I need to add to my configuration is shift: true
where does the rest of that go?
Looking at: How to use profiles - Incus documentation
I attempted to create a profile and edit it:
/tmp$ incus profile create c1-share-dir
Profile c1-share-dir created
/tmp$ incus profile set c1-share-dir shift=true
Error: Unknown configuration key: shift