ROS 2 Setup with Docker and Virtual Machines
In my latest post, I shared a ROS 2 setup using Docker. If you encounter issues running NoVNC, don't worry - there are alternative GUI options for Docker. Several solutions are available for you to explore. Now, I'd like to introduce a new setup using a Virtual Machine instead of Docker. You might wonder why. While Docker is fast, flexible, and easy to configure, it does have some drawbacks. One significant challenge is setting up bridged networking mode, which is notoriously difficult in Docker due to the lack of community support and documentation. However, bridged networking is essential when connecting to a real Turtlebot4 discovery server (such as a Raspberry Pi). With a virtual machine, it's a breeze to choose the bridged networking option. You can still find the same repository here: https://github.com/doanhtu07/test-ros2-docker I've updated the README to direct users to the appropriate setup instructions. For the Virtual Machine setup, the repository supports both VMWare (Fusion + Workstation) and VirtualBox. If you're concerned about the complexity of setting up a VM, don't be - I use Vagrant, a tool similar to Docker Compose but designed for managing multiple virtual machines. With my configuration file, all you need to do is to run a single command vagrant up , and the entire VM environment will be ready for you. That said, while Vagrant is great, be aware that virtual machines can be quite slow when it comes to initializing and preparing dependencies for ROS 2 and Turtlebot 4. It took me around 9 to 10 minutes to install everything, which made the development cycle for the config file quite slow. Feel free to try it out and reach out if you run into any issues!
Read article >