sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 66 forks source link

Issues Building and Launching Minirouter (/init: 59 /miniccc: not found) #1538

Closed namelessfaceless closed 3 months ago

namelessfaceless commented 4 months ago

Describe your environment

  1. minimega version 2.9
  2. Ubuntu 22.04.04
  3. Go compiler version 1.22.3 linux/amd64
  4. KVM minirouter

Describe the bug I'm having some issues getting minirouter up and running on a vm. I have minimega installed and am able to launch other images, but for whatever reason I can't get minirouter to work. 

I'm following the KVM section in Module 30: Networking - minirouter, but whenever I spin up the  VM and view it through miniweb, the image attached is what the VM retorts. minirouter_vm_errors

It's worth saying that vmbetter is not spitting any errors while building minirouter. 

My versions of bird, dnsmasq, and ovs-vsctl are up to date: BIRD version 1.6.8 dnsmasq version 2.9.0 ovs-vsctl version 2.17.9

To Reproduce Hard to say. I would say follow the tutorial but I suspect it worked for the author!

Expected behavior A minirouter vm to spin up and not be missing /miniccc.

Let me know of anything that could help with solving this issue. I can upload the .kernel and .initrd files vmbetter built somewhere if it's useful to look at them.

Thanks for your help, Dane

aherna commented 3 months ago

Looks like the image is missing the the miniccc binary in the root directory of /, if you update the image to include that it should be fine. How did you build the image?

namelessfaceless commented 3 months ago

I built the .initrd and .kernel using vmbetter and the minirouter.conf found in misc/vmbetter_configs:

/bin/vmbetter -branch stable -level debug misc/vmbetter_configs/minirouter.conf This command pops out a minirouter.initrd and minirouter.kernel in my minimega directory, which I then was spinning up and getting the result in the first post.

In the minirouter_overlay folder, the init file is there, along with the miniccc and minirouter binaries (both about 4MB?).

It's worth noting that minimega is installed under /opt/ for me. I'd assume vmbetter operates using a relative file path, but if it doesn't maybe this is part of the issue?

Strange.

aherna commented 3 months ago

I suspect a broken symlink somewhere. Try copying the miniccc and minirouter binaries from the bin folder to the overlay folder and rebuild the image.

namelessfaceless commented 3 months ago

Done! I'm still having the same result however. This time around, neither binary made it to the VM: vm_output

I've also attached the terminal output from trying to build the VM. I start with showing what's in the minirouter_overlay folder, and then build using the command mentioned earlier. Most of it is debootstrap and cpio doing their things, but maybe someone might spot something in there I'm not seeing.

minirouter_build_debug_output.txt

The only warning I could find was one warning that apt does not have a stable CLI interface. There is also some kerfuffle early on about finding a default.conf file.

ashahn1 commented 3 months ago

There is another underlying issue here in the screenshots. Errors are present in the image which prevent minirouter from functioning. This is due to incompatibilities with the most recent debian in the "stable" branch. Change the branch to "buster" and minirouter and miniccc will be able to function correctly. The build command should look like this:

/bin/vmbetter -branch buster -level debug misc/vmbetter_configs/minirouter.conf

I am not entirely sure why its not copying over the miniccc and minirouter executables, the log shows that it copied them. init is clearly there. Whats in the root directory of the router image?

namelessfaceless commented 3 months ago

Setting the branch to buster fixed the issue! If the version of debian supported for vmbetter isn't going to change soon, the docs should reflect this and call for 'buster'?

Thank you all for your help.