Note: These instructions are set up for using Qemu/KVM. If you have virtualbox installed, you cannot have kvm installed at the same time. It's possible to run mininet via the
sudo apt-get -y -qq install \
kvmtool cloud-utils genisoimage qemu-kvm qemu-utils \
moreutils mtools
mkdir mn_ws
cd mn_ws
wget https://github.com/mininet/mininet/releases/download/2.3.0/mininet-2.3.0-210211-ubuntu-20.04.1-legacy-server-amd64-ovf.zip
unzip mininet-2.3.0-210211-ubuntu-20.04.1-legacy-server-amd64-ovf.zip
qemu-img convert -p -f vmdk mininet-vm-x86_64.vmdk -O qcow2 mininet.qcow2
qemu-img resize mininet.qcow2 +30G
We will need to enable nbd
sudo modprobe nbd max_part=8
sudo qemu-nbd --connect=/dev/nbd0 mininet.qcow2
Install gparted. Use it to expand the partition.
sudo apt install gparted
sudo gparted /dev/nbd0
Resize /dev/nbd0p2
to fill the space.
Then repeat and resize /dev/nbd0p5. Apply your changes.
Unmount the image.
sudo qemu-nbd --disconnect /dev/nbd0
We can now launch mininet.
It is assumed your local ros2 work space has the code checked out. To launch our vm we need only run the following (feel free to save to script).