Remote view to To Hyper-V Guest Virtual Machines - virtualization

My software can discover all the hyperv vms (a software agent is installed in the hyperv host which returns the information). From my software I can do any operation on the vm. Now I want to take a remote console view of the hyperv vms from my software. It can be a web based or flash based or any other way.... How to accomplish this ?

Do you want to get the printscreen from the console or to control the VM through console remotely?
for the first one, Hyper-V provides an API through WMI where you can get the printscreen as a picture.
for the second one, you can simply use vmconnect.exe to connect to the console which comes with RSAT (remote administrative management pack, you can install it on Win7) or inbox on server edition. The remote control of the console is done by RDP (Remote Desktop Protocol) which is the same as you run mstsc.exe to connect to a remote server. But it's using a different port and some customized metadata during initialization. You may look at the implementation by reverse-engineering vmconnect.exe with Reflector.

Related

Running bat files on a remote Windows 10 computer with PowerShell

Here is another variation on the popular subject: PowerShell remoting. I have a system with a number of VMs hosted on a Hyper-V server. I have a need to launch programs on them remotely. I succeeded in doing this from the very Hyper-V host (I believe Microsoft calls this PowerShell Direct). I run
Invoke-Command -VMName MyVM -ScriptBlock {Mybatfile.bat}
which successfully logs into MyVM using the credentials of the current Hyper-V host login and spawns there MybatFile.bat with administrative privileges.
Unfortunately, I expect my system to be transitioned to a VMWare vSphere host, and such option will no longer be available. I hope to learn how to run Invoke-Command from one of the VMs. I understand that this may require some prep work on both the VM I am logged into and the target VM. All the VMs have an administrator account with identical credentials.
What makes this a bit more tricky is several of my VM share the same system name (reported e.g. in the properties of "This PC" as "Device Name"). They have unique VM names as they appear in the Hyper-V manager, and will have unique VMWare names. Ideally I want to keep it that way, and address the target VM by a static private IP of its virtual network adapter, or perhaps by some unique VM ID that will continue to be available on VMWare vSphere.
Thank you in advance.

Manually configure routing tables for azure virtual network (point-to-site)

I am having trouble connecting to my virtual network using the azure VPN client on windows 10 (I get an error about the certificate not found).I found a way to manually configure the VPN, I can successfully connect to it, ping my virtual machines from my local machine, ping my local machine from my virtual machines, remote desktop to it with the virtual network IP address (or hostname) and even connect to my shared folders on my local machine from the Virtual machines. What I can't do, and want to do is to connect to my shared drives on the VMs from my local machine (it works perfectly when I connect with the azure vpn client from windows 7). I've noticed when you connect through the vpn client it actually sets up the routing tables for you. So my question is: How do you configure it manually with powershell?
PS: For some reason you can't go to the IPV4/6 or any properties on your VPN connection on windows 10, So i have to do everything through powershell.
The problem wasn't the routing tables. The problem was that there was credentials stored in my my Credential Manager (Control Panel\All Control Panel Items\Credential Manager) for the VM which was incorrect, I think, I cleared it, and all worked. And by the way, I got the Azure VPN client to work on my windows 10 machine with help from this article

VMWare: Unable to access web server running on guest OS (Oracle Enterprise Linux 6.5) from host (Windows 7)

I am hosting a Oracle Linux 6.5 OS using VMWare on my windows 7 laptop. The VM is configured to use NAT networking configuration, and I am able to ping the guest OS successfully from my windows machine. Also, I am able to access internet from within my guest OS.
However, I am unable to access a web application running on port 8080 on a web server hosted within the guest OS using a browser in my host OS. The application is however accessible when accessed from a browser within the guest OS.
Some observations that may be of some use:
1. Neither my laptop, nor the VM have a static IP address.
2. I am able to ping my guest OS from host, and vice versa
3. Firewalls are disabled on both my laptop as well as the guest OS
Any help would be highly appreciated
The reason for the above issue could be mostly because of firewall settings/rules enabled in guest OS OEL. To check the rules you can type iptables -L -n at bash prompt which will display FILTER rules (CHAIN INPUT/OUTPUT/FORWARD).
Adding filters to allow the host to access guest http protocol would make things work. On the other hand, if this is for developmental purposes you can completely disable the firewall filter by saying
service iptables stop. Keep in mind that this is not a safe approach as it exposes your guest to the world without a firewall especially if you are using a bridged network connection.

Cannot access Azure VM throught rdp but remote powershell works

I need your help, any idea is welcome.
[skipable]
Here's the situation : i was working on a VM hosted in Microsoft cloud (Azure), everything was fine. This VM was supposed to be a Domain Controller (Active Directory), which was link to many VMs (i was working on grid computing with many compute nodes). Everything was setup correctly. The next step was to host a WCF service on a IIS server accessible through https. Therefore i opened port 443 on firewall as well as an valid endpoint for the VM (azure portal). From there things get weird. Opening endpoint 443 on the azure portal didn't work as expected, i needed to reboot the VM. Then i cannot access through RDP connection anymore :-(. However i succeed to take control of the VM via powershell remoting.
[Question]
How can i restore rdp connection via powershell remoting ONLY ? I tried to disabled firewall, open port 3389, capture an image of the vm to recreate it etc.. but nothing worked. Any idea ? i don't want to loose all my work, my fresh service etc..
Thanks you!

VirtualBox VM guest to pop up a window to the host machine

Question mark
I'm wondering whether it's possible for the VM guest machine to pop up a window to the MS-Windows host machine once a task is done within the VM (not an email). If I'm not dreaming, how to achieve that ?
Why
The VM is a simulator for a production server. Code is written within the host IDE and tested straight into the VM. So files are transferred manually from the IDE to the VM, and then automatically moved, formatted, chmoded, chowned and so on in the VM. This process can take a while, so I want to warn the devleopper once the process is over. The developper have no access to the VM and shall not necessary have one.
Config
Tool: VirtualBox 4.1
host: MS-Windows XP or Windows seven
guest: VM Debian
shared dir: yes
network : bridged connection
If this ability existed, it would be quite a security hole in VirtualBox. Guest VMs gaining access to the host machine's OS is not a good thing! As such, I don't think it's possible to accomplish this in a supported manner.
Instead, think of it as two separate machines. What mechanisms do you have for causing alerts or popups on one machine from another? Is anything like IMs, netsend, etc enabled in your environment?