how to create virtual switch in Hyper-v when host is allocated with static ip? - hyper-v

Able to create virtual switch using Hyper-v manager, when host is not in static ip mode..
Is there any difference in creating virtual switch using power shell cmdlets and UI

When I use below power shell cmdlets able to add virtual switch in static ip mode.
Get-NetAdapter ,
Add-VMNetworkAdapter ,
Set-VMnetworkAdapter

Related

Windows Server 2019 - VMs on Hyper-V cant get network

I have some trouble with my windows server 2019 running Hyper-V, for the background my windows server run on an ESXI infra.
It is impossible for me to get any internet access nor domain access on my Hyper-V virtual machine, this is how my host configuration look like
Host network
For me all look good, but when I turn on my virtual machine this is what I get
VMs network
VMs ping
I can see the machine getting a IP from my DHCP server, but it is impossible for me to ping any of the gateway, DNS.
My DHCP
This is how my virtual switch look like
vSwitch Hyper-V
And if needed my Ipconfig of my Windows server Hyper-V host
Hyper-V host network
I think that i have now tried everything I could, I don't see why my machine can get a DHCP IP, but can't communicate with any of my server.
I already have a topic posted on SpiceWorks (https://community.spiceworks.com/topic/2326264-hyper-v-wont-provide-internet-access-on-my-virtual-machine?page=1#entry-9231547), the last answer suggested that the problem came from my vSwitch on Hyper-V, but even after recreating a new one I can't get anything.
If you have any idea that can help me to achieve my configuration even the slightest one I'll gladly take it.
First thing I would like to ask, you are doing a Double Nested Virtualization, meaning: [ESXi] is the BareMetal Hypervisor, then inside of this Host you have at least 2 VMs, one name "SRVPARDC001" & the Hyper-V VM named "TESTHYPERV" , and inside this last one you have another VM called "VDI-Master" , if this is correct, you are asking:
*Why is VDI-Master, not getting internet, when SRVPARDC001 has leased an IP address ( 192.168.1.118) ?
My question is, why does the ipconfig output for VDI-Master show IP 192.168.1.121 , which per your DHCP, should be leased to the Desktop
Would it be possible to use a different subnet for the Virtual Switch inside the Hyper-V , to eliminate routing/dhcp issues?
My impression is that there is an issue on how the virtual switch is configured on the TESTHYPERV vm, since that virtual switch should be allowing the traffic upstream to the ESXi host and then out via your gateway/router/firewall device.

Hyper-v Open Virtual Machine

After rebooting is it possible to open a Hyper-V virtual machine without going through the Manager? It seems like it is already running in the background or maybe it is just in its last state.
If the OS in the Hyper-V virtual allows for remoting and also it is on the same network as the attempt to open a remote desktop to that virtual.
Note that the default network adapter for a virtual will provide a different IP address than what the local network provides to the server. You will most likely want to create a network adapter (in Hyper-V) which shares the network card to the virtual and the virtual will get its IP address from the local network.
If you can ping it, then it can be remoted to..but other things within the virtual has to allow for remoting.
Upon reading the OPs comments, it is clear that the need is to launch the virtual outside of Hyper-V. Hyper-V uses VMConnect.exe to achieve that...and that is available.
One can do that in an elevated Powershell shell such as:
vmconnect {Local/remote computer name} {Virtual Name}
such as
vmconnect Hyperion W10-Zephyr
where Hyperion is the local computer name and W10-Zephyr is the virtual's name.
See also Connecting to Hyper-V virtual machines with PowerShell

How could I access my VM in my host machine (By different IP)?

I want to access the virtual machine IP in the host (by ping or curl or something), but it is not ok. How could I make it?
The host machine is a win10 PC.
A virtual machine using VMware workstation 15, Ubuntu 16.04 server. It has IP address 192.168.178.138 and 10.0.0.11. I can access the 192.168.178.138, but cannot access 10.0.0.11. (no matter ping or curl...)
All are NAT mode in VMware Workstation.
Now I have a web application running on 10.0.0.11:80. How could I access it in my host machine.
Btw I have another VM with 192.168.178.39 and 10.0.0.31, and this VM can access the 10.0.0.11:80 by curl.
I can show the topo as below.
(A little Chinese but it won't affect reading, just ignore it)
Yes, now I solve this question by myself.
It seems that you cannot use the Host-only mode (Actually I can only use this mode...).
You need to set the virtual interface in your host PC (The IP, gateway, or anything else...);
Then you need to set in the VMWare workstation, set it to use speical lan (VM net 2 for me);
Then you can access it from the host machine and other vm, maybe you need to search something like NAT translation in VMWare workstation to access your web application deployed in the VM from outer network.
That's what I do, now I can access my horizon dashboard in the browser (The Ubuntu server don't have any browser... T-T sad ...)
Settings Picture

Is there any option to create virtual machine in Esxi hypervisor directly using any of the sdks provided by vmware

Currently I'm trying to create a vm in a Esxi server using Perl SDK provided by the vmware. The Vcenter host and name must be specified in create_vm.pl to create the vms in the Esxi server directly.
Is there any other SDK(like java) supports to install the vm directly on the Esxi serve without specifying the Vcenter.
link:https://www.vmware.com/support/developer/viperltoolkit/doc/utilityappsdoc/vmcreate.html
You just use the IP or hostname of the ESX/i host where it asks for vCenter. Keep in mind write operations are only supported on licensed versions of ESX/i so if you are using the free version it wont work.
I havent used PERL SDK for VMware, but I have used PowerCLI and PyVmomi for my tasks and the APIs require Host/vCenter IP as their host input.
When you provide VC as the host input, you get the objects related to vCenter for that VM, and if you provide ESXi host IP, you can create,manipulate VMs based on the limits of an ESXi server

Which footprint can identify in Virtualization?

Think this example:
You are using Windows as a host machine and you are using ( virtualbox ) Linux for virtual machine. When you connect to the internet from virtual machine, someone try to track you. Now, can tracker find your host machine's footprint or just virtual machine's footprint? So, from the connection of virtual machine, the host machine can identifiable?
I try to search that but i can't find any result. Maybe i don't know the right words.
No, the host machine won't be identifiable