WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Ghetto webAccess for ESXi

Ghetto webAccess for ESXi

12.12.2011 by William Lam // 14 Comments

I got the idea for this post a few months back after noticing several questions on the VMTN forums on how to enable webAccess for ESXi. With ESXi, the webAccess interface is no longer available as it was with classic ESX. After seeing the question and randomly browsing through the various flings on VMware Labs, I noticed an interesting fling called Ops Panel for ESX. Ops Panel provides a simple javascript that leverages the vSphere MOB to perform basic power operations for virtual machines and it is loaded onto the homepage of a classic ESX host remotely using Greasemonkey.

I immediately wondered if I could run the javascript directly on an ESX or ESXi host without the use of Greasemonkey. With a quick tweak of the default index.html homepage, I was able to get a simple "ghetto" webAccess running on both an ESX and ESXi host. I also ran into several bugs, one that dealt with how the power state of a virtual machines was being captured by the differences in the ESX(i) 4.0, 4.1 and 5.0 APIs and a recent fix to a CSRF (Cross-Site Request Forgery) vulnerability in ESX(i) 4.1 Update 1 that made it difficult to get Ops Panel running on more than just ESX(i) 4.0.

I reached out to the fling creator Ivan Donchev and he was kind enough to help assist me in the issues I ran into and also provided an updated version of his script to properly handle both the power state and the CSRF workaround. He recently published an update to his script a few weeks back supporting both ESX 4 and ESXi 5 but missed ESX(i) 4.1 support due to limited amount of testing. This was an easy fix and I modified the script to include support for ESX(i) 4.1 and also changed the default power off operation to a guestOS shutdown. The modified version of the script can be downloaded here.

When you browse to the homepage of your ESX(i) host using the browser, you will be prompted to login which require the same credentials as if you were to login to the host directly using the vSphere Client or vSphere MOB.

Once you have logged in, it will search for all virtual machines running on the host and generate the list of virtual machines and their respective power states.

You can then perform the appropriate power operation such as a power on, shutdown or suspend using the icons on the right. This can be really useful if you don't have access to vCenter Server, vSphere Client or SSH access to the host but just have a web browser.

To load the Ops Panel script on an ESX(i) host, you will need to do the following:

Note: These instructions are applicable for both ESX and ESXi, but with ESXi, it is important that the commands to copy both the modified index.html and Ops Panel script to docroot are executed as changes are not persisted after a reboot for ESXi hosts.

You can also add this to your kickstart file by appending the lines above in your %firstboot stanza so you automatically get Ops Panel after install. Though this will not give you a full webAccess that classic ESX did but it definitely is a useful way to quickly get to your virtual machines and perform simple power operations using a web browser.

More from my site

  • Disable LUN During ESXi Installation
  • Automating Active Directory User Management in ESXi Kickstart
  • Automating Active Directory Domain Join in ESX(i) Kickstart
  • How to create custom ESXi boot menu to support multiple Kickstart files?
  • ESXi Simple Web (aka less ghetto webAccess)

Categories // Uncategorized Tags // esx4, esx4.1, esxi 5, esxi4.1, kickstart, mob, web access

Comments

  1. Zoli says

    12/15/2011 at 2:35 pm

    Hello,
    very interesting idea, and would be useful if it is working.
    I followed your instructions on a fresh install of ESXi 5.0, but there were some error, and after correcting them it is not working at the end.

    1. can't download ops.js from the given address
    http://air.primp-industries.com/esxi41u2/ops.js

    I used this one: http://download.virtuallyghetto.com/ops.js

    2. the sed command don't work, finally i edited the index.html manually.

    Now when i check the ESXi homepage, look at the source, the modifications are there, i can get the ops.js with the url, but there is no visible change on the page.

    Tried with IE, FF and Chrome, no errors, but nothing happens.

    I hope can help,
    Zoltán

    Reply
  2. http://1b0b.wordpress.com says

    12/20/2011 at 11:49 am

    Many thanks for this great manual!

    Reply
  3. William says

    12/20/2011 at 7:32 pm

    @Zoli,

    The "air.primp-industries" is the kickstart host in my lab. To download the script, you need to use http://download.virtuallyghetto.com/ops.js

    Regarding the sed, make sure you're properly escaping the slashes. If it was loaded succesfully, it will prompt you for a login. If not, then there maybe a typo index.html and ensure ops.js is reachable.

    Reply
  4. Zoltán says

    12/21/2011 at 4:21 pm

    Yep, finally it is now working. (Found the typo, I left an unwanted escaping backslash in the html code.)

    Again, simple, but excellent solution,

    Thanks William!

    Reply
  5. SongPing(Alfred) says

    09/19/2012 at 3:11 am

    Hi,

    I can't download ops.js from http://download.virtuallyghetto.com/ops.js. It seems the file is removed.

    Thanks.

    Reply
    • William says

      09/19/2012 at 5:11 am

      @SongPing,

      I had switch some storage provider, try it now.

      Reply
    • Anonymous says

      05/03/2013 at 7:10 pm

      still (or again) unavailable?

      Reply
  6. Sean Lv' Blog says

    12/21/2012 at 4:47 am

    @William

    it seems the script don't works well with ESXi 5.1. any idea?

    Reply
  7. advertising dissertation examples says

    12/31/2012 at 8:20 am

    Your analysis about this post Ghetto webAccess for ESXi are quite nice and also believable. I think you should do more study regarding the topic.

    Reply
  8. Anonymous says

    01/13/2013 at 8:42 am

    Hi, after the command:
    # update rc.local to automatically restore changes
    echo "cp -f /vmfs/volumes/datastore1/ops.js /usr/lib/vmware/hostd/docroot/ops.js" >> /etc/rc.local
    echo "cp -f /vmfs/volumes/datastore1/index.html /usr/lib/vmware/hostd/docroot/index.html" >> /etc/rc.local
    i have a meesage: "can't create /etc/rc.local: Operation not permitted"
    What does it mean!?

    Reply
    • William says

      01/13/2013 at 6:33 pm

      Is this for ESXi 5.1? If so, editing /etc/rc.local is no longer valid and you need to use /etc/rc.local/local.sh instead for any custom init boot commands

      Reply
    • chelmi says

      06/14/2013 at 2:19 pm

      I've tried it on 5.1 without any success, installation went fine, but it keeps stating: "Loading...." did anything chance on 5.1 that prevents it from working ?

      Used to work fine on another host with 4.1 and 5.

      Reply
  9. Wei Kin Huang says

    09/21/2013 at 1:44 am

    I wrote a simple webapp based on this. It shows cpu/memory usage of the host and individual vms. I fine it useful to run quick operations.
    https://github.com/weikinhuang/esxi-simple-web
    I only tested this on ESXi 5.x. Would appreciate help in adding more features.

    Reply

Trackbacks

  1. ESXi and VMware Workstation: quick way of getting Console screenshots in PNG format; some URLs on your ESXi machine « The Wiert Corner – irregular stream of stuff says:
    05/16/2015 at 12:39 pm

    […] of removing the base index page, you can also turn it into virtuallyGhetto: Ghetto webAccess for ESXi as ESXi cannot be used for Installing the VMware vSphere 5.1 Web Client | VMware Support Insider […]

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023