Monday 24 December 2018

Run VMware Virtual Machine without using the web interface


I have installed the VMware and the only option to log into the Virtual Machine is via the web interface. This way poses several uncomfortable moments:



  1. Need to enter the web-interface of VM infrastructure Web Access. As a part of the process, the browser tells me that the link (on localhost) is not trusted bla-bla-bla - need to "proceed anyway".

  2. Need to authenticate with login/pass.

  3. Need to open console from web-interface. The plugin that opens a console is an IE plugin only (neither Chrome, nor Firefox are supported).

  4. Finally, I am there and all is smooth and running.


All I am asking is kinda shortcut or at least a better way to reduce the 4 action items (described above) to 1 or 2. That would be terrific.


The screenshot might help: enter image description here



Answer



You can call the executable that is contained within this IE plugin directly from the command line. It opens up the VM window just as usual, but without the need to go through the browser or use another remote desktop solution. It's called vmware-vmrc.exe




Locating the vmrc Exectuable


In order to do all that, you need to find the vmware-vmrc.exe file.




  • If installed through IE, I guess it's in Application Data\VMware Remote Console (Web) or something like that.




  • If installed in Firefox, search the Firefox profile for the VMware extension. Never mind that it doesn't actually work in FF, you could also install the extension in Firefox 2.0 or something and then extract it from the profile folder there.




Once you have located the vmware-vmrc.exe file, place it somewhere in your PATH. Either just add the IE plugin folder or copy it. Important: If you copy it, you need the whole contents of this folder (all dll files and executables), not just the vmware-vmrc.exe file.


I 7zipped the whole thing for you to download in case you can't find it. Can't promise though that it's the latest version that works on all systems.


Once you have it in the PATH, you can call it from anywhere without having to specify the full path.




Using vmrc


Call it like this:


vmware-vmrc.exe -h 127.0.0.1:8333 -u  -p  "[standard] machinename/file.vmx"


  • -h 127.0.0.1 is the URL of your web interface, with the appropriate port. The neat thing is that this command also works over LAN and even over Internet, as long as the port is forwarded. That way you can access the virtual machines from outside.


  • -u and -p are the credentials you use to login there




  • "[standard] machinename/file.vmx" specifies your virtual machine (see below for more info).






How to find out the name of your VM


"standard" is the name of the default container. The following two depend on the name of your virtual machine. It's the one you find under "Target" in the web interface. The vmrun documentation has an explanation of that on page 7.


In your case, it should be named something like "[standard] Ubuntu 64bit/somefile.vmx"


To find out the real name of the VM, you can run the following command


vmrun -T server -h https://127.0.0.1:8333/sdk -u  -p  list

This will list all the VMs you have in the correct format for the above command to pass. In your case it will be something like "[standard] Ubuntu 64bit/something.vmx". The vmrun should be somewhere in C:\Program Files\VMware\VMware VIX.




Automating everything


You could place the vmware-vmrc.exe line in a .bat file and then just call the batch file to avoid having to type this all manually. For example, you can create batch files for single virtual machines and put them on your Desktop. Then, just double click the files and the virtual machine window opens.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...