Page 1 of 1

Compiling using vagrant/virtual box

Posted: Wednesday 06 January 2021 16:32
by Number8
Thanks to the very detailed information found in the wiki https://domoticz.com/wiki/Build_Domotic ... th_Vagrant I managed to get the compilation done on a Windows 10 host. However I faced a number of issues that I managed to resolve that I think is worth to share. It turns out that my user folder name has got an accented character. In order to get VirtualBox running I had to :
- create a directory junction

Code: Select all

mklink /J link target
I had to let VAGRANT know about this junction.

Code: Select all

setx VAGRANT_HOME c:/users/link
I had to change default path for VM in VB, found in File/Parameters in order to avoid the same problem
I had to change slightly vagrant configuration file
- Adapt number of processors and memory allocated
- set variables name and email of my github repo (I overlooked these two at first place)
When everything was done I was able to compile and "vagrant ssh" to the VM.
However I struggled to get this done with ssh in windows shell. After installation of openssh, after long searches I was able to ssh

Code: Select all

ssh -i c:\HashiCorp\debian-domoticz/.vagrant/machines/vgdomoticz/virtualbox/private_key -p 2222 [email protected]
IP address of the remote machine can be found with

Code: Select all

ip addr show
At this stage I was wondering how to ssh with a public address. For that I added in vagrant configuration file

Code: Select all

config.vm.network "public_network", ip: "192.168.21.105"
I can ping this address, but when I try to connect connection refused is returned. I understood that in that case there is no more port forwarding since it has it own IP address. So the correct instruction is:

Code: Select all

ssh -i c:\HashiCorp\debian-domoticz/.vagrant/machines/vgdomoticz/virtualbox/private_key [email protected]
In case one wants to keep the address private then put in config file

Code: Select all

config.vm.network "public_network", ip: "192.168.56.105"
And SSH

Code: Select all

ssh -i c:\HashiCorp\debian-domoticz/.vagrant/machines/vgdomoticz/virtualbox/private_key -p 2222 [email protected]