Nvidia JetPack installer for TX2 needs to run on a Ubuntu host machine with sudo permission. It leaves residuals on the host. when run again a period of time later, the version from the residual may conflict with the current updated versions of other packages from the repo.

To solve or work-around this problem, it may be desirable to run the JetPack installer in a quickly-created docker container. How would you do it, step-by-step?

  • Added 'on X over ssh' to the title.
    – minghua
    Jun 21, 2018 at 14:18

2 Answers 2


Docker is primarily aimed at running applications. But JetPack also heavily modifies the system. Hence after playing around with it for a while I understood that docker is not a good match. LXD, a full linux environment container is suited much better for the task. I got the GUI working in lxd - just follow any of the tutorials for LXD or LXC GUI and after it works you additionally need to install nvidia drivers for JetPack GUI to work (at least if you use Nvidia drivers on the host machine):

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-XXX # replace XXX with the same version your computer is running!

And you will get everything running fast and smoothly.. only that I spent too much time figuring out how to map Jetson USB port to LXD and finally I did not figure it out. But I guess it should be possible if you know how to handle low level kernel stuff well.

The solution

Anyway, finally I understood that I am using wrong tools for the task. I do not need a container. The Jetson host will not be something I want to run and destroy all over again (this is what containers are good for). All I want is portability - that I would not be tied to ageing Ubuntu 16.04 on physical host, but could use newer software. A good old virtual machine (VM) is much easier, saves my time and nerves - and is fit for the purpose. So (make sure Jetson is connected first):

  1. Run lsusb command in host terminal (if host is linux) to check if Jetson shows up. If not, something is wrong. It should show a line like this: Bus 001 Device 003: ID 0955:xxxx NVidia Corp.

  2. Install VirtualBox, download Ubuntu 16.04 .iso from ubuntu.com and install it on a new VirtualBox machine.

  3. Install VirtualBox extension pack from VirtualBox.org (required to attach USB devices). NB! You need to download the same version that your VirtualBox is. Double-click the installer and VirtualBox will install it
  4. Add your user on the HOST (not VM) to vboxusers group (on Linux at least):

    sudo usermod -aG vboxusers $USER

  5. Restart (or possibly log off-on) to make the group add to take effect

  6. Enable USB 2.0 support from Settings->USB (or possibly USB 3.0 support - I did not try, USB 2.0 worked for me)
  7. Restart the VM
  8. Attach Jetson from Devices - USB
  9. Run lsusb command in VM terminal to check if NVidia device (Jetson) shows up. If not, something is wrong. It should show a line like this: Bus 001 Device 003: ID 0955:xxxx NVidia Corp.
  10. Run JetPack from VM

It might not be a solution for everyone, but if your goal was just not be tied to using Ubuntu 16.04 as your main operating system, a virtual machine is a way to go. Much easier than messing around with containers.

  • Actually I did mostly the same but could not get the mapped USB port to work properly and reliably. I sure will give it another try based on your instruction when next time I need to install a new kernel to a target. Just to clarify, after the step 10: [1] Are you able to flash the whole system including OS, driver, and filesystem inside the vbox guest? [2] After the OS, driver and filesystem, does it continue to install all the JetPack packages successfully?
    – minghua
    May 27, 2018 at 0:31
  • 1
    Hi! Yes, I successfully flashed the OS, driver and the file system and then it continued to install all the packages just like on physical host. USB 2.0 support worked for me, but some posts say that only 3.0 worked for them, so it is worth trying out both.
    – MF.OX
    May 31, 2018 at 16:31

Here is only a partial answer. The limitation is that it does not include the part to flash the OS, drivers, and file system.

After the basic OS and file system have been flashed and installed to the target TX2 module, the TX2 can be accessed through a network port over ssh. Thus the Ubuntu host only needs to: Get a GUI with sudo ability, and access network. By default, a docker container has the ability to connect to the network that the host can connect to. To get a GUI, there are a few approaches. Below is the X-over-ssh approach with help from two scripts. The script includes operations to add the current user to the sudo group too.

Run the first script to create a Ubuntu docker image customized for running the JetPack 3.1 installer. Then run the second script to create a docker container with static user name and password, and mounted host user account home to the container guest user home.

The first script to create a docker image:

# current uid and gid
curr_uid=`id -u`
curr_gid=`id -g`

# create bb.dockerfile:
cat << EOF2 > bb.dockerfile
 FROM ubuntu:xenial-20180417
 ARG UNAME=testuser
 ARG UID=1000
 ARG GID=1000
 RUN groupadd -g \$GID \$UNAME
 RUN useradd -m -u \$UID -g \$GID -s /bin/bash \$UNAME

 RUN apt-get update
 RUN apt-get install -y openssh-server openssh-client iputils-ping sudo
 RUN apt-get install -y lsb-release libgtk2.0 xterm vim rsync sshpass
 RUN mkdir /var/run/sshd
 RUN echo 'testuser:screencast' | chpasswd
 RUN sed -i -e '/sudo/ s/$/testuser/' /etc/group

 ENV NOTVISIBLE "in users profile"
 RUN echo "export VISIBLE=now" >> /etc/profile

 CMD ["/usr/sbin/sshd", "-D"]

docker build --build-arg UID=${curr_uid} --build-arg GID=${curr_gid} \
    -f bb.dockerfile -t testimg .

The last CMD usually can be replaced by these two if not running a sshd service:

CMD /bin/bash

The second script to create the container:

docker run -it -d \
    -v /tmp/.X11-unix:/tmp/.X11-unix  \
    -v $HOME:/home/testuser \
    -p 2022:22 \
    --name testcontainer -P testimg

To access the container guest Ubuntu, run on the host using password screencast:

ssh -l testuser -p 2022 -X localhost

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.