Instantly share code, notes, and snippets.

@xbb /README
Last active Nov 13, 2018

Embed
What would you like to do?
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
If you don't see the MacOS libs in the file make sure you download it from MacOS.
Edit the bat/sh file according to your needs.
The file structure should look like this:
start-virtual-console.bat (.sh if Linux/MacOS)
avctKVM.jar
jre/<jre home here>
lib/avctKVMIO.dll (.so if Linux, .jnilib if MacOS)
lib/avmWinLib.dll (.so if Linux, .jnilib if MacOS)
@echo off
set /P drachost="Host: "
set /p dracuser="Username: "
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set dracpwd=%%p
.\jre\bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html"
#!/bin/bash
echo -n 'Host: '
read drachost
echo -n 'Username: '
read dracuser
echo -n 'Password: '
read -s dracpwd
echo
./jre/bin/java -cp avctKVM.jar -Djava.library.path=./lib com.avocent.idrac.kvm.Main ip=$drachost kmport=5900 vport=5900 user=$dracuser passwd=$dracpwd apcp=1 version=2 vmprivilege=true "helpurl=https://$drachost:443/help/contents.html"
@TiloGit

This comment has been minimized.

TiloGit commented May 8, 2017

tested also with following JRE on Win2012 R2 system

Java(TM) SE Runtime Environment (build pwa6460sr16fp41-20170215_04(SR16 FP41))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Windows Server 2012 amd64-64 jvmwa6460sr16fp40-20161215_329869 (JIT enabled, AOT enabled)

Java(TM) SE Runtime Environment (build pwa6470_27sr3fp60ifix-20161110_01(SR3 FP60+IV90630+IV90578))
IBM J9 VM (build 2.7, JRE 1.7.0 Windows Server 2012 R2 amd64-64 Compressed References 20161005_321280 (JIT enabled, AOT enabled)

@muffetman

This comment has been minimized.

muffetman commented Jul 25, 2017

Handy script, thanks! I modified the bat version slightly to automatically download avctKVM.jar:

@echo off

set /P drachost="Host: "
set /p dracuser="Username: "
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (%psCommand%) do set dracpwd=%%p

ECHO Grabbing avctKVM.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVM.jar','.\avctKVM.jar')"

.\jre\bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html"

@alsobrsp

This comment has been minimized.

alsobrsp commented Aug 10, 2017

Awesome, thank you

@PalestinianLiberator

This comment has been minimized.

PalestinianLiberator commented Aug 16, 2017

Thank you so much for this!

I'm running into some issues running the script on Mac, however. When running the .sh file, everything goes fine until I receive the error: "Could not find or load main class com.avocent.idrac.kvm.Main".

Any idea as to how I would remedy this?

@ptmorris1

This comment has been minimized.

ptmorris1 commented Aug 28, 2017

Great stuff! Thanks!

What about getting this working for iDRAC 7 and 8? I tried using the script with Java 8 but always get error: "Login failed with an access denied error." It almost works...

@joedel94

This comment has been minimized.

joedel94 commented Nov 11, 2017

Hey I keep getting a connection failed error message, any advice?

11/11/2017 01:43:32:025: Connection failed with exception: Connection refused:
connect
==== propertyChange: (SESSION_STATE):CONNECTION_FAILED====

@nhubbard

This comment has been minimized.

@stamster

This comment has been minimized.

stamster commented Feb 9, 2018

Fist off - thanks for the snippet and work-around. It was very useful to get an idea how it works behind the scenes - and that we don't actually need a web browser to kick-start console (our iDRAC6 does not even have a link for console, I had to hack it through viewer.jnlp!

I have managed to make it work - well, sort of "work". The thing is damn iDRAC6 in it's express` version simply does not support KVM.

Oh how I hate you Dell. Even more than I hate HP(E) and Intel together!

I'll stick with SuperMicro for good - they have HTML5 KVM which works from any device/browser! As a normal feature!

@NoLooseEnds

This comment has been minimized.

NoLooseEnds commented Mar 2, 2018

@stamster Did you actually get the console to work with iDRAC6 express? If yes, how?

@nizrael

This comment has been minimized.

nizrael commented Mar 4, 2018

Great thanks! It was very useful. But i have one big question with it - how can i include a virtual media library into this snippet?

@Acalanum

This comment has been minimized.

Acalanum commented Mar 26, 2018

Hi, trying to figure this out, new to messing with servers/java... Where would I get the libs for my operating system? I was able to download the avctKVM.jar from my server iDrac.

Also, where does the .bat file come from?

Sorry for the noob questions

@colomb001

This comment has been minimized.

colomb001 commented Apr 12, 2018

@nizrael I spent some time getting the virtual media console to work. On windows, you need to open up avctKVMIOWin64.jar and avctVMWin64.jar, extract the .dlls contained therein and throw them in a lib folder in the folder you have the start-virtual-console.bat. I've confirmed this works with both the 64bit and 32bit dlls extracted from the jars.

@lemassykoi

This comment has been minimized.

lemassykoi commented Apr 18, 2018

@colomb001 thank you so much for the keyboard tip

@codigobinario

This comment has been minimized.

codigobinario commented Apr 26, 2018

Hi, How can I get avctKVMIO.dll and a vmWinLib.dll?? I downloaded from google avctKVMIO.dll and get vmWinLib.dll from my java ultimate version installed in appdata\LocalLow\Sun\Java\Deployment... but I get a error message: "The native library for keyboard and mouse support failed to load. Pass all keys to server and single cursor support will not be available", and not run, I´m under win10 x64, thanks

@NoLooseEnds

This comment has been minimized.

NoLooseEnds commented May 4, 2018

I got this to work (on enterprise), but I'm having problems getting keyboard input to work. It does not register any keypress.
It does register if I use the menu to ie. trigger or something.

I'm on latest macOS, if that helps any.

@duckdave1

This comment has been minimized.

duckdave1 commented May 6, 2018

I get the error message
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

Thanks for advice, regards

@champsxs

This comment has been minimized.

champsxs commented May 16, 2018

Great script. Nice
if you add reconnect=2( got from the jnlp downloaded from iDrac web ) as a parameter when running the jar, then iDrac 7 also work (dnt know why, maybe due to ssl check).
But no luck with iDrack 8 :(

@champsxs

This comment has been minimized.

champsxs commented May 18, 2018

Again Thankz for the script it was a great start and gave a goog understanding of how stuff works under the hood. I have made few updates and now it works for iDrac 6/7/8, think it'll help someone

As .Net < 4 throws errors when creating Tls12 connections and sometimes it's so hard to change registry to enable those if you are in a common environment. As a work around I used this https://eternallybored.org/misc/wget/ to download avctKVM.jar from the server.
" wget.exe --no-check-certificate "https://%ipaddress%/software/avctKVM.jar"
"
and updated the JRE version >= 1.8 as 1.7 was complaining about SSL handshake with iDrac 8.

finally, add " del avctKVM.jar " at the end of the bat. As wget.exe won't replace (maybe im missing a switch ), then you are good to go :)

Also working on a shell script to use x11 forwarding to pop out as most of the time jump hosts are Linux.

@SgtKilgore406

This comment has been minimized.

SgtKilgore406 commented May 18, 2018

Thank you for the script, so much easier to get the console to connect. Couple of questions though, is there any way to get the Virtual Media Feature working with this script? Also, is this script compatible with the DRAC 5 card?

Thanks

@anarchydude

This comment has been minimized.

anarchydude commented May 22, 2018

I'm with @duckdave1, having the same issue with iDRAC6, NoClassDefFound when running both 1.7 and 1.6.

Edit: I can get the jnlp to run with Java baked in to Windows on 7u80 once video encryption is turned off. Still would rather hope for a universal solution like this one though ;-)

@avengerx

This comment has been minimized.

avengerx commented Jun 8, 2018

With JDK (Server JRE package) 7u80 I found here I could run the console even with encryption enabled using the .sh script (using cygwin here).

But I can't get the virtual media to work at all. From iDRAC 6 interfce, I see it is Enterprise, so it /should/ work. I've downloaded all .jar files pointed by viewer.jnlp, so it probably is a limitation by the way it is run. I see @nizrael also had the same issue than me.

Other than that, all seems to work, I can walk thru bios, type, reboot, and so on.

EDIT: to have virtual media working, just follow the steps into extracting the DLL (.so or .jnilib depending on OS). The avctKVMIO.dll and avmWinlib.dll files are within the avctKVMIO*.jar and avctVM*.jar, respectively. You have to choose between Linux32, Linux64, Win32 or Win64, depending on your OS.

In my case, windows 10 64-bit, it was Win64.

@sirtcp

This comment has been minimized.

sirtcp commented Jun 26, 2018

Hi,

I follow every step as mentioned even i extracted / un compressed the components of the jar file in "lib" folder however i am still getting this error
"Could not find or load main class com.avocent.idrac.kvm.Main". any help will be highly appreciated.

Thanks,
yousuf

@ruze00

This comment has been minimized.

ruze00 commented Jul 6, 2018

@sirtcp Do you have the avctKVM.jar file in the same folder as the script?

@rahim888

This comment has been minimized.

rahim888 commented Jul 13, 2018

I tried this out and it worked great on my mac.

  • downloaded the JRE 1.7.0.79 tar file (not the installer) and extracted it.

  • Downloaded the avctKVM.jar

  • Run the java cmd and hard referenced the locations of the files
    Works like a charm! Thank you

`

MBP:Progs$ ls
avctKVM.jar		avctVMMac64.jar
avctKVMIOMac64.jar	jre1.7.0.79

export drachost=
export dracuser=
export dracpwd=
/Users/Progs/jre1.7.0.79/Contents/Home/bin/java -cp /Users//Progs/avctKVM.jar -Djava.library.path=./lib com.avocent.idrac.kvm.Main ip=$drachost kmport=5900 vport=5900 user=$dracuser passwd=$dracpwd apcp=1 version=2 vmprivilege=true "helpurl=https://$drachost:443/help/contents.html"
@jaredcrean

This comment has been minimized.

jaredcrean commented Jul 14, 2018

Brilliant!!! This saves so much time. Thank you,

@jbone80

This comment has been minimized.

jbone80 commented Jul 23, 2018

Was finally able to get this script running. A couple of things that I had to go through a few times, 1. Don't hard code the IP of the idrac. I had put into my script Host: https://A.B.C.D and then put my username and it wasn't working. Maybe if I had just put the IP and not the https: it would have worked. 2. I had to create a folder on my computer to hold the jre folder I downloaded and extracted as well as a .lib folder I created to house the .dll's that you have to extract and download from the links in the "viewer.jnlp". In the viewer.jnlp there are multiple lines, I am running 64 bit so I used the nativelib lines. I also extracted the avctKVM.jar and copied the com directory out into the lib folder. So my folder structure looks like:

Console (main folder)

  1. Start-virtual-console.bat
  2. jre folder (extracted from the server-jre that I downloaded form the internet)
  3. lib folder
    a. com folder (extracted from avctKVM.jar)
    b. avctKVMIO.dll (extracted from viewer.jnlp Win64 section)
    c. avctWinLib.dll (extracted from viewer.jnlp Win64 section)

Once this was all set, I just ran the script using Powershell and it worked.

@kaiiorg

This comment has been minimized.

kaiiorg commented Jul 23, 2018

@joedel94 I know its been a while since you posted, but I got the same error. I found out that it was because I missunderstood what the

set /P drachost="Host: "
set /p dracuser="Username: "

lines did: I thought that the text in the quotes were just a place holder and you would need to modify the script to change the variables. They actually set the given variable name to the user input after prompting with the text in the string. So, when the script ran with your string set to, say, 192.168.0.0 and you hit enter after being prompted with that string, you're passing it an empty string. The console fails to connect with an empty string.

Try running the original script as is, then do the following in the console:

  1. Enter hostname/ip address of the DRAC
  2. Press enter key
  3. Enter username for DRAC
  4. Press enter key
  5. Enter password for that username
  6. Press enter key

Assuming there aren't any other problems (see below), you have your jre in the jre folder, and correct lib files in the lib folder alongside the script, that should run and connect the console.

Worst case, ignore the set lines and try to manually set your parameters in the long java line (though, I'd only do this for testing, as leaving a password in a script wouldn't be a very good idea):

.\jre\bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=192.168.0.0 kmport=5900 vport=5900 user="myUserName" passwd="SuperSecurePassword1" apcp=1 version=2 vmprivilege=true "helpurl=https://192.168.0.0:443/help/contents.html"

If that fails, you might be trying to access the wrong port (check the port number the console runs on in the web gui) or there might be a firewall between you and the DRAC blocking that port (5900 by default).

@DrDroop

This comment has been minimized.

DrDroop commented Jul 24, 2018

hard coding the password into the .bat file got it to work. I was having all sorts of authentication issues.

set drachost="192.168.1.10"
set dracuser="MyUserName"
set dracpwd="MyPassword"
.\jre\bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html"
@Gerk

This comment has been minimized.

Gerk commented Jul 25, 2018

Thanks, this works a treat. Running great on MacOS High Sierra using jre1.7.0_80

For the Mac users make sure to get both of the Mac jars from the .jnlp file and extract the libs from both of them (and put them into ./lib or whatever path you are going to use for that). Both viewer and Virtual media bits working as expected.

@tijldeneut

This comment has been minimized.

tijldeneut commented Aug 7, 2018

My two cents, it works flawlessly but sometimes my Keyboard doesn't work at all.
It turns out that it depends on the version of the avctKVM.jar:

  • Virtual Console 1.0 (1.07.0.17647) completely works
  • Virtual Console 1.5 (1.0.0.78) has keyboard issues (doesn't work)

If any is interested in the first version (that should work on any iDRAC6 device), I'll try to attach it... (rename it to 7z)
avctkvm 7z

@bglopez

This comment has been minimized.

bglopez commented Aug 9, 2018

Here is a version that makes assumptions about your paths (so fix them if they don't match) and also uses 7-Zip to extract the required DLL file. It gives you an option to use a port other than 5900 since some of our hosts use different ports.

@echo off

set /P drachost="Host: "
set /p dracuser="Username: "
set /p kvmport="KVM Port: "
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
	$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
		[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set dracpwd=%%p

md iDRAC6-%drachost%
cd iDRAC6-%drachost%
ECHO Grabbing avctKVM.jar from %drachost%
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVM.jar','.\avctKVM.jar')"
ECHO Grabbing avctKVMIOWin32.jar from %drachost%
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('http://%drachost%/software/avctKVMIOWin32.jar','.\avctKVMIOWin32.jar')"
ECHO Extracting .dll files to ./lib
"C:\Program Files\7-Zip\7z.exe" e avctKVMIOWin32.jar -oc:lib *.dll -r
ECHO Running KVM client
"C:\Program Files (x86)\Java\jre6\bin\java" -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.kvm.client.Main ip=%drachost% kmport=%kvmport% vport=%kvmport% user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html"
@CharlesB2

This comment has been minimized.

CharlesB2 commented Sep 4, 2018

This works great, finally a workaround for the broken iDRAC!

A few notes on Ubuntu:

  • It works with current version of Oracle's java
  • The window appears hidden, you have to blindly activate it with alt-space, and then select "maximize"
  • You need to extract the .so from both *Linux64.jar files, and put them in lib
@krubottom

This comment has been minimized.

krubottom commented Sep 7, 2018

I had to enable SSLv3 in java, I always got the error "connection failed"

Comment out "jdk.tls.disabledAlgorithms=SSLv3 in /lib/security/java.security

@wdz111

This comment has been minimized.

wdz111 commented Sep 14, 2018

Thanks for that great script!
I have IDRAC8, and original script didn't work. So I played a little bit, tried this and that, and finally it works! My configuration and what did I do:

I used Java 1.8 (64-bit in my case). Changed "java.security", as @krubottom advised (and BIG THANKS for that!) - withou it I got an Error.

In Idrac 8 Dell have changed DLLs, and now the DLLs in \lib folder is:
avctKVMIO.dll - from avctKVMIOWin32.jar (or avctKVMIOWin64.jar - for 64)
VMAPI_DLL.dll - from avctVMAPI_DLLWin32.jar (or avctVMAPI_DLLWin64.jar - for 64)
VMAPI_DLL.lib (idk if the jar need that, but I decided to paste it inside \lib folder also) - from avctVMAPI_DLLWin32.jar (or avctVMAPI_DLLWin64.jar - for 64)

With original script Console launched just fine, but I got "access denied" message.
So - I dig inside my "viewer.jnlp" a little bit, and changed some parameters - and - it works! So - my command for running avctKVM.jar looks like:

.\jre\bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 reconnect=2 version=2 vm=1 "helpurl=https://%drachost%:443/help/contents.html"

@Be5qP4Y3Fzaj

This comment has been minimized.

Be5qP4Y3Fzaj commented Sep 17, 2018

Hi,

I follow every step as mentioned even i extracted / un compressed the components of the jar file in "lib" folder however i am still getting this error
"Could not find or load main class com.avocent.idrac.kvm.Main". any help will be highly appreciated.

Thanks,
yousuf

I'm experiencing the same issue as well.

@area1509

This comment has been minimized.

area1509 commented Oct 1, 2018

Hello everyone, I have the remote console working on a dell R710 with the enterprise idrac.
Thanks to MathieuW here: https://www.dell.com/community/Systems-Management-General/iDRAC6-Virtual-Console-Connection-Failed/td-p/5144021/page/2

I am running the latest java version as of 10/01/2018.
Version 8 Update 181 (build 1.8.0_181-b13)

Go to here or wherever you installed java.
C:\Program Files\Java\jre1.8.0_181\lib\security\java.security

Comment out this line in java.security with a #
jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024,
and add the IP address (https://IPhere) and (https://IPhere:443) to the security tab of the java control pannel.

I don't know what security implications this has but it works.

@PVi1

This comment has been minimized.

PVi1 commented Oct 3, 2018

I have fixed it on ubuntu 16.04 with openjdk-8-jre:amd64 8u181-b13-0ubuntu0.16.04.1 the following way.

This is an original statement in java.security:

jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 1024, \
    EC keySize < 224, DES40_CBC, RC4_40, 3DES_EDE_CBC

You have to delete SSLv3 and 3DES_EDE_CBC for iDrac console to be functional again.

So it will look like this:

jdk.tls.disabledAlgorithms=RC4, MD5withRSA, DH keySize < 1024, \
    EC keySize < 224, DES40_CBC, RC4_40

Enjoy!

@flippedcracker

This comment has been minimized.

flippedcracker commented Oct 10, 2018

@Be5qP4Y3Fzaj

Hi,
I follow every step as mentioned even i extracted / un compressed the components of the jar file in "lib" folder however i am still getting this error
"Could not find or load main class com.avocent.idrac.kvm.Main". any help will be highly appreciated.
Thanks,
yousuf

I'm experiencing the same issue as well.

In case you, or anyone hasn't figured this issue out yet, I had to download the avctKVM.jar file separately, the same way as the files listed in the .jnlp file (ipaddress/software/avctKVM.jar) and put it in the same directory as the .bat/.sh file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment