How to set up a virtual machine to run Domoticz

From Domoticz
Revision as of 03:29, 24 April 2020 by Laurend (talk | contribs) (How to set up a virtual machine to run Domoticz)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Virtual Machine Creation

  1. Download a virtual machine program to create tour virtual machine. VMware Workstation Pro can be downloaded here: https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html
  2. Install VMware Workstation Pro.
  3. After installation is complete, open VMware Workstation Pro and choose the “Create a New Virtual Machine” option.
  4. Then, choose the “Typical (recommended)” configuration type and hit “Next.”
  5. The next step is to choose a guest operating system for your virtual machine and a version. For running Domoticz, you should choose a Linux operating system with a Ubuntu version.
  6. The next step will ask you to name your virtual machine and choose a location to store your virtual machine.
  7. The next decision is to choose the disk capacity of your virtual machine. The maximum disk size in GB should be set to 32GB and choose the split virtual disk into multiple files.
  8. The final step is to review the creation of your VM and in this step, there is an option to “Customize Hardware” which should be chosen.

   The default settings of the hardware are shown below:


To successfully run Domoticz, you are going to want to change these settings so they match the configuration below:

Download Domoticz on VM

  1. On your virtual machine, open the terminal application.
  2. Then, type the following command in the terminal, which will copy all the files from Domoticz’s GitHub into a directory named “dev-domoticz”: git clone https://github.com/domoticz/domoticz.git dev-domoticz
  3. Next, you will need to get into the new directory you created (dev-domoticz), pull the most recent version of the code from Domoticz’s GitHub, and then start building the code. The commands you will need to do that are written below: cd dev-domoticz git pull cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt -DUSE_OPENSSL_STATIC="NO" make
  4. Next, in order to run Domoticz on your VM, you should run the following commands: cd domoticz sudo ./domoticz


Then, in order to access the Domoticz interface via your virtual machine, you will need to open FireFox or another browser and go to: localhost:8080


Being able to access the Domoticz interface via the steps above ensures that you have Domoticz running correctly on your VM.

Download and Install Visual Studio Code

  1. Download and install Visual Studio Code on the VM you created.
  2. Then, open Visual Studio Code. File --> Open Folder --> dev-domoticz --> OK(top right corner). Following these actions will download all the Domoticz files into Visual Studio Code, so that you are able to make code changes in Visual Studio Code. This is what Visual Studio Code should look like when your Domoticz files download.


Making Changes to Domoticz

  1. After making any code changes in the dev-domoticz files, you need to use Control + S to save any changes that you made to the code.
  2. Then, you need to go back to terminal and run the following commands to build the version of Domoticz complete with your code changes: cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt -DUSE_OPENSSL_STATIC="NO" make
  3. Use the commands below to run Domoticz with your code changes cd domoticz sudo ./domoticz

Use a web browser on your VM to go to the address: localhost:8080 and use the interface to test your changes to see if they are correct