Skip to main content

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

  1. Start the VM.

  2. Log in with the following credentials: ubuntu, ubuntu.

  3. To set a temporary static IP, edit the Netplan file by executing the following command:

    sudo nano /etc/netplan/50-cloud-init.yaml
  4. 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.

    note

    The 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.

VM Setup

  1. Save with ctrl+x > y > enter.

  2. To set the IP, execute the following command:

    sudo netplan apply
  3. Connect to the virtual machine via PowerShell on the Utility VM, execute the following command:

    ssh ubuntu@[IP of VM]
  4. Log in with the Ubuntu credentials again.

    note

    It's easier to connect to the virtual machine via PowerShell as it allows easy copying and pasting.

Deploy the Virtual Appliance

  1. While connected to the Linux VM you just created via SSH on the Utility VM, execute the Sysprep script:

    sudo ./sysprep.sh
  2. Fill in the fields as requested:

VM Setup

FieldDescriptionRequired / Optional
HostnameName of VMRequired
IDScopeCan be copied from the Azure IoT Hub Device Provisioning ServiceRequired
DeviceIDSame as Hostname, which is the name of VMRequired
Symmetric keyCan be copied from the individual enrollment in DPSRequired
Default UsernameYour default usernameRequired
Public SSH keyPublic SSH key, if set upOptional
Static IPYRequired
Static IPv4 AddressThe assigned IP address of the original VMRequired
Subnet MaskThe 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
GatewayCan be found by typing ipconfig /all in the Hypervisor cmd line.Required
NameserversThe DNS server names can be found by typing ipconfig /all in the Hypervisor cmd line.Required
Proxy addressProxy server addressOptional
  1. The VM will now restart and install the required applications and settings. Wait until the machine has restarted a second time.

  2. 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.