Skip to content

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:

  1. Add both YOUR_USER and OTHER_USER to a group, let's call it robotdevers.
  2. In YOUR_USER, change the group ownership of the robotdev folder to be robotdevers, recursively (run chgrp -hR robotdevers /path/to/robotdev)
  3. Now, log into OTHER_USER. Add it to docker group: sudo usermod -aG docker OTHER_USER. Log out and log back in.
  4. 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.
  5. Create a robotdev docker image specifically for this user: source docker/build.noetic.sh --gui --nvidia --tag-suffix=nvidia-OTHER_USER
  6. Create a container from that image you just created: source docker/run.noetic.sh --gui --nvidia --tag-suffix=nvidia-OTHER_USER.`
  7. Activate that container (user dls and then dsh <container_id>, if you have those custom bash functions).
  8. Now, if you cd into ~/repo/robotdev, and run ls -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.
  9. Add group robotdevers within the container. Add OTHER_USER to that group within the container.
  10. Now, if you ls -l again, 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).

Clone this wiki locally