-
Notifications
You must be signed in to change notification settings - Fork 6
Setting up robotdev for another account
Kaiyu Zheng edited this page Sep 11, 2022
·
3 revisions
Say you have robotdev working on your user account. And you'd like a different user on the same machine also work with robotdev.
Suppose your username is YOUR_USER. The other user's username is OTHER_USER.
You can clone robotdev for that user (This is recommended in most cases).
Otherwise, one approach is:
- Add both YOUR_USER and OTHER_USER to a group, let's call it
robotdevers. - In YOUR_USER, change the group ownership of the
robotdevfolder to berobotdevers, recursively (runchgrp -hR robotdevers /path/to/robotdev) - Now, log into OTHER_USER. Add it to docker group:
sudo usermod -aG docker OTHER_USER. Log out and log back in. - Create a symbolic link to robotdev:
ln -s /home/YOUR_USER/repo/robotdev ~/repo/robotdev. This avoids copying robotdev as it may be quite large. - Create a robotdev docker image specifically for this user:
source docker/build.noetic.sh --gui --nvidia --tag-suffix=nvidia-OTHER_USER - Create a container from that image you just created:
source docker/run.noetic.sh --gui --nvidia --tag-suffix=nvidia-OTHER_USER.` - Activate that container (user
dlsand thendsh <container_id>, if you have those custom bash functions). - Now, if you cd into
~/repo/robotdev, and runls -l, the user and group names should be binary numbers (because robotdev inside the container completely mirrors what's on the host machine. The binary numbers refer to a user/group name, which is not present for your just-created container. - Add group
robotdeverswithin the container. Add OTHER_USER to that group within the container. - Now, if you
ls -lagain, you should see the group showing 'robotdevers'. And you should be able to access and write to the robotdev directory.
The caveat of this approach is the 'robotdev' folder will be shared between users. This could cause permission issues if the files created by the OTHER_USER are not in 'robotdevers' group. Be careful. To avoid this, you can clone robotdev again instead (This is recommended in most cases).