How to connect ESXi vm console from ESXi host console - esxi

Trying to automate ovf installation on a ESXi server.
I am able to deploy the ovf using ovftool then when I powered-on that vm it ask for input immidiatelly in boot console.
/vmfs/volumes/Datastore-3/vmware-ovftool/ovftool -dm=thin -ds=<datastore> --acceptAllEulas "<ovf_path>" "vi://<username>:<password>#<esx host>"
Note : I am using a custom OVF which ask for inptu before starting boot process.
if I use vSphare clinet to connect to guest vm then I can interact with that VM console and provide required input.
But I need to do it from command line.
As I need to automate the process of OVF deploy and system configuration.
I can easily login to ESXi host termimal via SSH.
But how to get VM terminal from ESXi host terminal.
In some blog I found that the defaule terminal of Guest VM is serial.
I have also tried PowerCLI tool but no luck!!

you can try vmrc.exe
It can be used to get console of ESXi guest VM without using vSphare Client.
But as per your requirement, I think its not fully automatiable.
Once you get the remote console you need to do some GUI automation to interact with Guest VM console.
Example of vmrc.exe command :
"C:\Program Files (x86)\VMware\VMware Remote Console\vmrc.exe" vmrc://<ESXi host username>#<ESXi host IP>/?moid=<VM ID>

Related

Making Jenkins localhost publicly available within the same network

I am running my jenkins on localhost on my macmini which is my remote machine. All the tests are also running on that mac mini. However i want to share that localhost:8080 jenkins url to make it publickly so something like the eg.71.65.187.98:8080. so within the same network my coworkers can open the url and see the jenkins. How can i do that? without using any external service?
Run ifconfig in the terminal. it'll show all the network interfaces on your Mac. One of them is the network your machine is actively connected to.
If your Mac is on a wired connection that should be en0. Make a note of the address after inet, that should be the address your machine uses
It depends on how you start your jenkins server. If you use the generic war file then you can add the command flags --httpPort=yourPort --httpListenAddress=yourAdress.
A complete command could look like this:
java "${JAVA_OPTS}" -Xms256m -Xmx256m -jar jenkins.war --httpPort=8787 --httpListenAddress=192.168.0.171
Depending on your OS it may be possible that you need to tell your firewall to open the desired port.
I was able to solve the issue since i installed my jenkins using brew. first I needed to :
nano /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.plist
then change the httpListenAddress to 0.0.0.0
Then by using ifconfig on the terminal i was able to get my IP address and i was able the use IP address:8080 inside my network.

Jenkins : Unable to access jenkins in local machine

I'm trying to create a Test automation Pipeline to run my selenium scripts, I installed Jenkins in windows Remote Server 2012. Used following cmd($ java -jar jenkins.war) to start jenkins. It is working fine in Remote server with url:http://localhost:8080/
But when I'm trying to access it outside Remote server(my local machine) it is not working. am getting error message "This site can’t be reached"
My local laptop and Remote server is under the same proxy org network.
Can someone help how to resolve this issue , so that other folks can access it and run jobs when required from their laptops
Thanks in advance
Access Windows Firewall.
Add an inbound rule to allow port 8080 and
try accessing the url from any machine in the network.
you could allow/restrict access to all IPs, range of IPs or allow all. But to nullify the issue and confirm if its an issue with whitelisting IPs, I'd first allow access from all IPs with the wildcard *
for Debugging if its a port whitelisting issue, you could also telnet from the machine that you are trying to access this machine -
try
telnet remote machines IP Port
note: do not use a colon for port input just use a space

Possible to Change Jenkins URL? : http://localhost:8080

Possible to Change Jenkins URL? : http://localhost:8080
Currently I have jenkins setup on a virtual machine.
Is it possible to setup Jenkins on a URL which is more is accessible for other users?
For example I dont want other users to access test results by connecting to the Virtual machine instead I want them to access a URL from their own device in turn enabling them to login and see test results via jenkins.
thanks for you help
Let's say IP of your virtual machine is 192.168.x.x.
Open the Port 8080 via firewall and then change the URL of jenkins from
"Manage Jenkins >>Config Sys >> Jenkins Location>" to "http://192.168.x.x:8080"
Now you can access it from other machine on same network domain.Just have to hit the url http://192.168.x.x:8080
You can now create different users with different privileges for the same.
You can find it under Manage Jenkins >> Manage Users >> Create Users.
It is related to networking. The machines should be on the same network, so they can talk to each other (unless you have public IP).
The ONLY rule to give access is, that machines can talk to each other (of course, in their language, 0's & 1's).
I suggest following things to do to share the URL:
Ask the users to connect to the same network that your machine is in.
Verify whether they are able to PING your machine IP (get it from ipconfig command for windows - router assigns IP for your machine, that starts with 192.168 or 10.10). command example: ping 10.10.1.10
If any issues in Ping, it might be Windows Firewall or Anti-virus which might be blocking, so allow the IPs in your firewall so they can access your machine.
Then ask them to access Jenkins using the following URL http://[IP of your machine:8080]
We want the Jenkins web interface to be accessible from anywhere (not
just on the local machine), so we’re going to open up the config file:
sudo nano /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.plist
Find this line:
<string>--httpListenAddress=127.0.0.1</string>
And change it to:
<string>--httpListenAddress=0.0.0.0</string>
RF : Installing Jenkins on macOS

Amazon EC2 Ubuntu server - opencv::imshow() causes ": cannot connect to X server localhost:10.0"

So I am trying to run my code on an Amazon EC2 instance running Ubuntu Server 14.04 LTS.
I realized that my code is breaking with the following error when imshow() is called:
: cannot connect to X server localhost:10.0
I an connecting through putty and I have selected "Enable X11 Forwarding".
I can remove all imshow calls but I actually need to use them. Is there a way to enable this functionality while connecting to the EC2 instance through Putty ?
You also need to be running an X windows server on your desktop (where you're running putty). There are several available, and setup depends on which you choose. If you want a very easy solution, there's MobaXterm, which is an ssh client and X11 server combined. There's a commercial version and a free home edition (with some limitations).

call jmx operation on a local running process

I have a java process on a linux server, which runs with this option: -Dcom.sun.management.jmxremote
So I cannot just connect to this process via jconsole running on my local pc (because neither port nor -Dcom.sun.management.jmxremote.ssl=false options are set up).
But still, how can I connect to the application and run some operations over some of its MBeans? It this possible? I have a ssh access to the server and would be able to run it "locally" on the server (but not changing the options unfortunately)
According to JMX documentation the -Dcom.sun.management.jmxremote option
Enables the JMX remote agent and local monitoring via JMX connector published on a private
interface used by jconsole. The jconsole tool can use this connector if it is executed by
the same user ID as the user ID that started the agent. No password or access files are
checked for requests coming via this connector.
The naming is a bit unfortunate because it in fact enables the local monitoring only.
Since you can not change the options but can access the server via SSH the only option is to use X server forwarding (ssh -X ...) and run jconsole (or better yet jvisualvm which has specific optimisations for running remotely).

Resources