why not use docker? you can use it with network=host to connect to network and there are already images with ubuntu and ros2. if you want anything with display it can be done too.