pippolo84 / advanced-go-course-vm

Test repository for the Advanced Go Course Virtual Machine
https://golab.io/en/agenda/advanced-go-course
0 stars 0 forks source link

`vagrant up` errors when creating network #1

Open belimawr opened 2 years ago

belimawr commented 2 years ago

When I run vagrant up I get the following error

 belimawr@TARDIS~/devel/advanced-go-course-vm(main|✔) % vagrant up          
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/hirsute64' version '20211025.0.0' is up to date...
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "ipconfig", "vboxnet4", "--ip", "172.28.128.1", "--netmask", "255.255.255.0"]

Stderr: VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

1:WARN belimawr@TARDIS~/devel/advanced-go-course-vm(main|✔) %

This seems to be caused by a bug in the latest version of VirtualBox (6.1.28), here some issue suggesting to downgrade: https://github.com/kubernetes/minikube/issues/12765#issuecomment-951935198

Unfortunately I did not manage to downgrade my VirtualBox, for some reason 1.6.26 would not run reporting multiple errors.

As the error was related to networking, I removed config.vm.network "private_network", type: "dhcp" from the Vagrantfile, that solved the problem for me.

I'm not completely sure about the networking requirements for this course, but at least my VM works now and it can access the internet. If it does not affect the course, I suggest making this change to the Vagrantfile.

I'll create a PR for it.

I'm running ArchLinux.

pippolo84 commented 2 years ago

Hi @belimawr , thank you for the PR. AFAIR, the only reason for that setting is being able to attach a browser on the host to a pprof server that run on the guest. We will use it to show profiling and tracing data on a browser. I used that because, for some reason, exposing just a port was not enough.

BTW, I think you should be fine, you only need to run the pprof server on your host machine, so to attach the browser directly.

Let see if someone else experiences this program, if so, tomorrow I will warn about this possible issue and point to your solution.

Thank you again!

belimawr commented 2 years ago

Hi @belimawr , thank you for the PR. AFAIR, the only reason for that setting is being able to attach a browser on the host to a pprof server that run on the guest. We will use it to show profiling and tracing data on a browser. I used that because, for some reason, exposing just a port was not enough.

BTW, I think you should be fine, you only need to run the pprof server on your host machine, so to attach the browser directly.

Let see if someone else experiences this program, if so, tomorrow I will warn about this possible issue and point to your solution.

Thank you again!

I see. I looked for other options to be able to access the guest machine, and config.vm.network "public_network" works for me as well. In that case the VM gets an IP address directly from my router and I have full access to the VM through it's IP address.

Let's see if someone faces some issues, that can be another option as well.