Setting up the Virtual Appliance on Virtual Box
Pre-requisites:
- Hypervisor set up in the Utility VM.
- IoTHub enrollmend created in the DPS.
Get the VM Ready
-
Start the VM.
-
Log in with the following credentials:
ubuntu, ubuntu
. -
To set a temporary static IP, edit the Netplan file by executing the following command:
sudo nano /etc/netplan/50-cloud-init.yaml
-
Fill in the variables using the IP setting of your current plant. Make sure you use the same IP as the VM you started in the above steps.
noteThe first address is the PRD or ACC VM address, not the one of the Hypervisor. The gateway and the DNS server names can be found by typing 'ipconfig /all' in the Hypervisor command line.
-
Save with ctrl+x > y > enter.
-
To set the IP, execute the following command:
sudo netplan apply
-
Connect to the virtual machine via PowerShell on the Utility VM, execute the following command:
ssh ubuntu@[IP of VM]
-
Log in with the Ubuntu credentials again.
noteIt's easier to connect to the virtual machine via PowerShell as it allows easy copying and pasting.
Deploy the Virtual Appliance
-
While connected to the Linux VM you just created via SSH on the Utility VM, execute the Sysprep script:
sudo ./sysprep.sh
-
Fill in the fields as requested:
Field | Description | Required / Optional |
---|---|---|
Hostname | Name of VM | Required |
IDScope | Can be copied from the Azure IoT Hub Device Provisioning Service | Required |
DeviceID | Same as Hostname, which is the name of VM | Required |
Symmetric key | Can be copied from the individual enrollment in DPS | Required |
Default Username | Your default username | Required |
Public SSH key | Public SSH key, if set up | Optional |
Static IP | Y | Required |
Static IPv4 Address | The assigned IP address of the original VM | Required |
Subnet Mask | The subnet mask of the network. Can be found by typing ipconfig /all in the Hypervisor cmd line. Make sure to use the prefix notation. | Required |
Gateway | Can be found by typing ipconfig /all in the Hypervisor cmd line. | Required |
Nameservers | The DNS server names can be found by typing ipconfig /all in the Hypervisor cmd line. | Required |
Proxy address | Proxy server address | Optional |
-
The VM will now restart and install the required applications and settings. Wait until the machine has restarted a second time.
-
You can now log in with the username you set over SSH. Upon first login, you will have to specify a new password as no password is set. You will be logged out as the new password is set, but due to certificate login, you no longer need the password to log in.