-
Notifications
You must be signed in to change notification settings - Fork 14
Hyper V Device
tatiane edited this page Mar 16, 2021
·
6 revisions
This page shows how to set up a Hyper-V VM to simulated an IoT device that can be connected to the MBP installed in the host computer.
Requirements:
- MBP installed and running on Windows 10 (Host OS)
- Hyper-V installed and enabled in the Host OS
- Guest image OS: Ubuntu 20.04 (download ISO file)
- Activate Hyper-V
Windows feature
and restart your PC
Go to "Systemsteuerung\Programme\Programme und Features"
-
Start
Hyper-V-Manager
as administrator -
Create a Hyper-V virtual switch
Go to "Virtual Switch Manager..."
Set properties as above
- Set static IP address of newly created switch
Go to "Systemsteuerung\Netzwerk und Internet\Netzwerkverbindungen"
- In
Hyper-V-Manager
, create a VM and indicate the created switch and downloaded .iso image
-
Start up the VM and install the OS
-
Configure VM static IP address and restart the VM
- Test if connection works by pinging the VM from the host machine
ping 192.168.10.60 -n 3
- Install
openssh-server
in the VM
sudo apt-get update
sudo apt install openssh-server
- Enable
key login
in the VM
-
Edit file
/etc/ssh/sshd_config
-
Add
public key
to/.ssh/authorized_keys
-
Make sure the VM normal user is the owner of this file
ls -la
- Change owner if necessary
sudo chown mbp authorized_keys
- Test ssh connection from host machine
ssh -i .\hyperv-vm [email protected] -v
- If the connection don't work and the guest machine log in
/var/log/auth.log
shows the messageno matching key exchange method found
:
- Add at the end of file
/etc/ssh/sshd_config
:
#Legacy changes
KexAlgorithms +diffie-hellman-group1-sha1
- In the MBP, configure remote broker with IP address configured in step 4.
- In the MBP, add device using the hyper-v VM IP address
- Create a sensor and connect it to this device. If installation of the operator is successful but starting is not, probably the windows firewall is blocking the port 1883. You can desactive the windows firewall or add to the windows firewall the mosquitto.exe as allowed application.
Universität Stuttgart - MBP Team 🔧