Open damthemad opened 1 year ago
It's indeed not working all the time. Two things to check:
Get-VMNetworkAdapter -VMName linux | Select VMName, IPAddresses
If you run the command in powershell as administrator and it's not there, then something else is wrong.
PS, I just changed the hosts file format. The original order in line 99 was wrong.
Hi,
The user which run the task is member of group admin
The powershell command returns nothing but this is normal as you pass an argument "-VMName linux" and my VM is not named "linux". if i change the argument with my vm name, the command is ok and returns VM's IP Address.
According to readme, i understand that this program should list all vms, so the name shouldn't be fixed. Do you mean that it is only functional for one unique vm whose name is linux ? It seems that's true since i can see this powershell command in source code (i can't compile ccp source code, no tools, and last time i did c++ was almost 20 years ago). Perhaps, coud you run "Get-VM | Get-VMNetworkAdapter | Select VMName, IPAddresses" and iterate on the results ?
br
I've added a new release here: https://github.com/aaalgo/hyperv2hosts/releases/tag/1.0.2
You need to supply the guest name with the command line argument "-n vmname" or "--name vmname". If you want to change the hostname, you can use "--host-fmt vm_{}", where {} will be replaced with guest name.
I'm not sure if this will work. I chose C++ so I can build something standalone, but maybe a python script will be better for the purpose.
It doen't work. I'v added --name xxxx (xxx = vm name) and always nothing in my host file. since i now know how to detect starting event, thanks to Readme, i will write my own tool. br
Hi,
Nice tool but unfortunately it doesn't works for me.
I see that the program is triggered as a new line apparead in the file the first time i started an hyperv vm, but this is only a comment, and after other trials (shutdown and restart vm) nothing happenend.
the line who appeared is below :
[HYPERV2HOSTS] Updated at Tue Jan 31 18:48:44 2023
Windows 10/64
br