none
Set guest VM (Ubuntu 18.04) IP address from Hyper-V host - SOLVED RRS feed

All replies

  • I don't see why this will not work on ubuntu 18.04, most likely it's just some configuration.

    Have a look at this script that also tests the IP injection to guest. There is a single way of doing this, so any method will use the same code to handle the inject.

    https://github.com/LIS/LISAv2/blob/master/Testscripts/Windows/NET-IP-Injection.ps1

    Tuesday, February 11, 2020 10:02 AM
  • Code is the same as the one i'm using, and of course, it doesn't work. One big distinction in Ubuntu 18.04 is that it uses netplan and yaml file for setting IP address, i think this is the reason why it doesn't work
    • Edited by Dragan979 Tuesday, February 11, 2020 12:34 PM
    Tuesday, February 11, 2020 12:34 PM
  • Code is the same as the one i'm using, and of course, it doesn't work. One big distinction in Ubuntu 18.04 is that it uses netplan and yaml file for setting IP address, i think this is the reason why it doesn't work

    That is most likely the issue - the python code on the guest side that changes the network settings based on what it gets from the host, that script simply updates the interfaces file, and of course netplan does not use that.

    This script must be updated:  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/hv/hv_set_ifconfig.sh?h=v5.6-rc1

    Tuesday, February 11, 2020 12:39 PM
  • Changed python script /usr/sbin/hv_set_ifconfig to edit yaml file, but when running it from Hyper-V server it doesn't work, (it seems, it only can edit files in /etc/networks folder), so i removed netplan and now can inject IP from Hyper-V host
    • Marked as answer by Dragan979 Wednesday, February 12, 2020 11:46 AM
    • Unmarked as answer by Dragan979 Wednesday, February 12, 2020 11:47 AM
    • Edited by Dragan979 Wednesday, February 12, 2020 11:47 AM
    Wednesday, February 12, 2020 11:46 AM