Skip to content

Instantly share code, notes, and snippets.

@xbb
Last active February 2, 2025 08:18
Show Gist options
  • Save xbb/4fd651c2493ad9284dbcb827dc8886d6 to your computer and use it in GitHub Desktop.
Save xbb/4fd651c2493ad9284dbcb827dc8886d6 to your computer and use it in GitHub Desktop.
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"
@ready4droid
Copy link

ready4droid commented Aug 23, 2020

Here is my batch file for windows 10 (64-bit, but easily changed for 32-bit)... it automatically downloads the jar files and unzips the .dll files if they don't exist so it can use the native dll libraries:

Also, keep in mind if you still have to update the java settings to allow the older TLS to work:
Java location .\jre\lib\security\java.security
Remove SSLv3 and 3DES_EDE_CBC from jdk.tls.disabledAlgorithms, should end up like so:
jdk.tls.disabledAlgorithms=RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40

@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

IF NOT EXIST "avctKVM.jar" (
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')"
)

IF NOT EXIST "lib" (
ECHO Creating lib directory
mkdir "lib"
)

IF NOT EXIST ".\lib\avmWinLib.dll" (
  IF NOT EXIST ".\lib\avctVMWin64.zip" (
    IF NOT EXIST ".\lib\avctVMWin64.jar" (
      ECHO Grabbing avctKVMWin64.jar from host...
      powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctVMWin64.jar','.\lib\avctVMWin64.jar')"
    )
    ECHO Renaming avctVMWin64.jar to avctVMWin64.zip
    rename ".\lib\avctVMWin64.jar" avctVMWin64.zip
  )
  ECHO Unzipping avctKVMWin64.zip
  powershell Expand-Archive ".\lib\avctVMWin64.zip" -DestinationPath ".\lib"
  rmdir ".\lib\META-INF" /s /q
  erase ".\lib\avctVMWin64.zip" /q
)

IF NOT EXIST ".\lib\avctKVMIO.dll" (
  IF NOT EXIST ".\lib\avctKVMIOWin64.zip" (
    IF NOT EXIST ".\lib\avctKVMIOWin64.jar" (
      ECHO Grabbing avctKVMIOWin64.jar from host...
      powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVMIOWin64.jar','.\lib\avctKVMIOWin64.jar')"
    )
    ECHO Renaming avctKVMIOWin64.jar to avctKVMIOWin64.zip
    rename ".\lib\avctKVMIOWin64.jar" avctKVMIOWin64.zip
  )
  ECHO Unzipping avctKVMIOWin64.zip
  powershell Expand-Archive ".\lib\avctKVMIOWin64.zip" -DestinationPath ".\lib"
  rmdir ".\lib\META-INF" /s /q
  erase ".\lib\avctKVMIOWin64.zip" /q
)

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"

@ready4droid
Copy link

@mermao1 @codigobinario
See my above post if you are still having issues with the .dll files if you're running 64-bit windows 10 it automatically pulls all files for you and checks if they exist first so it doesn't pull them every time.

@tyler56895
Copy link

Hi @ready4droid
I'm trying to get on a iDRAC 6 from a Windows Server 2012 R2 Treminal Server
I can't use your script as there is no WinZip.
Attached are 2 screenshots of your script and the unable to connect message we get when just selecting JavaWS to open the downloaded file.
Any help or support would be greatly appreciated.

iDrac_3
iDrac_2
iDrac_1

@ready4droid
Copy link

ready4droid commented Aug 24, 2020

Hi @ready4droid
I'm trying to get on a iDRAC 6 from a Windows Server 2012 R2 Treminal Server
I can't use your script as there is no WinZip.
Attached are 2 screenshots of your script and the unable to connect message we get when just selecting JavaWS to open the downloaded file.
Any help or support would be greatly appreciated.

Apologies, I updated my post. This is using the inbuilt unzip from Windows 10 (possibly server 2016?). I can look into 2012 to see if it has any unzip options and re-work the script for you, but if you check my post and edit the java algorithms (the iDRAC 6 uses an old TLS protocol that is disabled in newer versions of Java, which is why you are getting the connection failed). The .zip files failing is not the reason it's not connecting though, it's needing to modify/edit your java security settings to allow the TLS connection. Once you fix this, you can unzip the .zip files by hand and just make sure the .dll files are in the lib folder and it'll work 100% correctly (and as long as it finds the .dll files in the lib folder it won't try to download/unzip them again). Since there can be so many versions of java I did not have it try to modify the security settings automatically (as finding JAVA_HOME and parsing the file would require admin rights as well).

Ok, found this:
"Prior to Windows Server 2016 there wasn’t really an easy built-in way of compressing files into a .zip archive by command line without custom scripts or tools, until now."
"PowerShell 5.0 was recently released for Windows Server 2008, 2008 R2, 2012, and 2012 R2, so you can manually install it there as well to make use of Compress-Archive and Expand-Archive cmdlets. Note that the installation will require a system reboot."
https://www.rootusers.com/how-to-zipunzip-files-in-windows-with-powershell/

So it seems if you update powershell to a version > 5.0 the auto unzip should function properly from Server 2008 and up.

@tyler56895
Copy link

I'm not sure i have permission to install a newer version of power shell.
I've manually unzipped the files from the target iDRRAC and added them as in the screenshot, but still get unable to connect. To be honest, this is out of my experience and i'm not really sure what I'm doing. I also have the java.security file edited for version 6.

image

@ready4droid
Copy link

I'm not sure i have permission to install a newer version of power shell.
I've manually unzipped the files from the target iDRRAC and added them as in the screenshot, but still get unable to connect. To be honest, this is out of my experience and i'm not really sure what I'm doing. I also have the java.security file edited for version 6.

First, those files don't have to be in your jre\lib folder, just in a lib folder from wherever you are running the .bat file. So the layout should look like this (you can put in any folder, but this is how the structure should end up).

c:\idracscript\run.bat
c:\idracscript\avctKVM.jar
c:\idracscript\lib\avmWinLib.dll
c:\idracscript\lib\avctKVMIIinLib.dll

Second, if you're getting the connection failed, then it's a java issue someway. Either you need to add an exception for the site in the java configuration or something still isn't right in your security file. Also, I don't have server 2012 in order to do any testing so this is as much of a suggestion I can give. As long as you get the "Connection Failed" it is going to be an issue with java security. The .jar file will still run properly even without the .dll files, it will just use generic plugins that don't work as well for the IO and possibly be missing the ability to mount virtual CD's and stuff, but the connection itself should still establish.

@tyler56895
Copy link

Perfect, its working now, it was the file location that was stopping it!
Thank you for taking the time to respond and help.

@ready4droid
Copy link

Perfect, its working now, it was the file location that was stopping it!
Thank you for taking the time to respond and help.

Great to hear, glad you were able to get it working!

@netmanbworker
Copy link

netmanbworker commented Aug 27, 2020

I got this to work on Windows by doing the following:

1. Download **jre-8u201-windows-i586.tar.gz** (the last JRE before the new license)
   sha256: dc419a2ebd838e2f3d4e0a0efb02024abad464129d5d8decb8a7b6fbde552227
   md5: a44e40bb1f0f98a34fe13226b5f050eb
   sha1: cef8b9979a872e908c43f9a1d81b9a859dbcece7

2. Open jre-8u201-windows-i586.tar.gz in 7-zip, and then inside it also open the **jre-8u201-windows-i586.tar** file (still within 7-zip), then open the **jre1.8.0_201** folder, and then extract the contents to just **.\jre\**

3. Edit **.\jre\lib\security\java.security** in Notepad as follows:
   For the line: **jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \** remove only the **RC4,** bit

4. Download **https://192.168.0.120:443/software/avctKVM.jar** with web browser and put into root folder

5. Download **https://192.168.0.120:443/software/avctKVMIOWin32.jar** with web browser and put into **.\lib\** folder

6. Download **https://192.168.0.120:443/software/avctVMWin32.jar** with web browser and put into **.\lib\** folder

7. For both **avctKVMIOWin32.jar** and **avctVMWin32.jar** open in 7-zip and extract the containing .dll files into the **.\lib\** folder

This should work for a long time to come. But there will be more fun when the SSL Cert expires in 2024.

This worked for me too in August 2020. Thanks so much everyone!

@kmarfurt
Copy link

Worked perfectly for me with the ...Win64... files. Many Thanks to everyone!

@dylanmtaylor
Copy link

dylanmtaylor commented Sep 4, 2020

Thank you for this! Works in Arch Linux using the jdk-7u79-linux-x64.tar.gz tarball from https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html#license-lightbox

@j0mbie
Copy link

j0mbie commented Sep 17, 2020

So, I had to jump through a lot of hoops to get this to work, but it DID work. That said, in case others are having the same issues I had, I'm posting here to tell you what I did. Note that this was on an x64 Windows machine.

  1. Create a folder that you can easily navigate to using the command line. I will use "C:\idracfix" for this example.
  2. Create subdirectories "jre" and "lib" within "C:\idracfix". (In other words, create "C:\idracfix\jre" and "C:\idracfix\lib".)
  3. Create the "start-virtual-console.bat" file that is posted above and put it in your "C:\idracfix" folder.
  4. Download the older version of Java from the Oracle webpage. I used this page to download "Java SE Development Kit 7u80" (jdk-7u80-windows-x64.exe). You will have to create an Oracle account. You may be able to find this same file elsewhere on the internet if you Google for it. If you have a 32-bit system, download the x86 (i586) file instead.
  5. Extract the files from the executable you just downloaded. I used 7-Zip to do this.
  6. You'll end up with a "tools.zip" file. Extract the files from "tools.zip". I again used 7-Zip but since it's a regular .zip file, you can use Windows built-in unzipping/extraction utility.
  7. Put all the files and folders from "tools.zip" into your "C:\idracfix\jre" directory.
  8. Download your "viewer.jnlp" file from your iDRAC by clicking the "Launch" button on the iDRAC System Summary page. It will actually be named something fairly crazy. You can rename it to "viewer.jnlp" if you like, but it doesn't ultimately matter.
  9. Open your "viewer.jnlp" file in a text editor. I used Notepad++ so I could easily double-click the links you'll need from within the file, but regular Notepad works if you don't mind cutting and pasting into a browser.
  10. Find the first "resources" section. There will be a link within it to pull your "avctKVM.jar" file from your iDRAC. Use that link to download your "avctKVM.jar" file, and place it directly in your "C:\idracfix" folder.
  11. In your "viewer.jnlp" file, below the link to your "avctKVM.jar" file, there is more "resources" sections. Look for the one with your OS and architecture. If you're using 32-bit Windows, you want the architecture of "x86", and if you're using 64-bit Windows, you want the architecture of "amd64" or "x86_64". (Those last two should end up linking to the same files.) Using the same process you used to download your "avctKVM.jar", download "avctKVMIOWin64.jar" (32-bit: "avctKVMIOWin32.jar") and "avctVMWin64.jar" (32-bit: "avctVMWin32.jar").
  12. Extract the files from "avctKVMIOWin64.jar" (32-bit: "avctKVMIOWin32.jar") and "avctVMWin64.jar" (32-bit: "avctVMWin32.jar"). I again used 7-Zip for this.
  13. From the resulting files you extracted,, copy the .dll files and paste them in the "C:\idracfix\lib" folder. My .dll files were named "avmWinLib.dll" and "avctKVMIO.dll" but I cannot guarantee that yours will be the same names.
  14. You should now have a file/folder structure similar to this:

C:\idracfix\start-virtual-console.bat
C:\idracfix\avctKVM.jar
C:\idracfix\lib\avmWinLib.dll
C:\idracfix\lib\avctKVMIO.dll
C:\idracfix\jre\(A bunch of files from tools.zip)

  1. Open Command Prompt, as Administrator, and navigate to your "C:\idracfix" folder. ("cd C:\idracfix")
  2. Run the "start-virtual-console.bat" file from within Command Prompt. (Just type in "start-virtual-console.bat" and hit enter.)
  3. Fill in the requested information. However, it is at this point that I got the following error:

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

  1. This likely means that various .jar files need to be unpacked. This happens by itself when you run the actual installer, but since we needed to manually extract the files, it didn't happen.
  2. You can do this manually using the below command in Command Prompt from the "C:\idracfix" directory. Thanks go out to MultiplyByZer0 and Rigg802 at this link.

for /r %f in (*.pack) do "jre\bin\unpack200.exe" -r -q "%f" "%~pf%~nf.jar"

  1. Run "start-virtual-console.bat" again from the Command Prompt.
  2. Your iDRAC console should launch successfully this time!

@xsolutions-taylor
Copy link

Worked perfectly when I could not access with JNLP. Legend.

@ismar-baseit
Copy link

@j0mbie:
i did everything like you described but i get following error:
image
can you help me please?
thanks in advance!

@LaurentiuBoblea
Copy link

Here is my batch file for windows 10 (64-bit, but easily changed for 32-bit)... it automatically downloads the jar files and unzips the .dll files if they don't exist so it can use the native dll libraries:

Also, keep in mind if you still have to update the java settings to allow the older TLS to work:
Java location .\jre\lib\security\java.security
Remove SSLv3 and 3DES_EDE_CBC from jdk.tls.disabledAlgorithms, should end up like so:
jdk.tls.disabledAlgorithms=RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40

@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

IF NOT EXIST "avctKVM.jar" (
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')"
)

IF NOT EXIST "lib" (
ECHO Creating lib directory
mkdir "lib"
)

IF NOT EXIST ".\lib\avmWinLib.dll" (
  IF NOT EXIST ".\lib\avctVMWin64.zip" (
    IF NOT EXIST ".\lib\avctVMWin64.jar" (
      ECHO Grabbing avctKVMWin64.jar from host...
      powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctVMWin64.jar','.\lib\avctVMWin64.jar')"
    )
    ECHO Renaming avctVMWin64.jar to avctVMWin64.zip
    rename ".\lib\avctVMWin64.jar" avctVMWin64.zip
  )
  ECHO Unzipping avctKVMWin64.zip
  powershell Expand-Archive ".\lib\avctVMWin64.zip" -DestinationPath ".\lib"
  rmdir ".\lib\META-INF" /s /q
  erase ".\lib\avctVMWin64.zip" /q
)

IF NOT EXIST ".\lib\avctKVMIO.dll" (
  IF NOT EXIST ".\lib\avctKVMIOWin64.zip" (
    IF NOT EXIST ".\lib\avctKVMIOWin64.jar" (
      ECHO Grabbing avctKVMIOWin64.jar from host...
      powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVMIOWin64.jar','.\lib\avctKVMIOWin64.jar')"
    )
    ECHO Renaming avctKVMIOWin64.jar to avctKVMIOWin64.zip
    rename ".\lib\avctKVMIOWin64.jar" avctKVMIOWin64.zip
  )
  ECHO Unzipping avctKVMIOWin64.zip
  powershell Expand-Archive ".\lib\avctKVMIOWin64.zip" -DestinationPath ".\lib"
  rmdir ".\lib\META-INF" /s /q
  erase ".\lib\avctKVMIOWin64.zip" /q
)

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"

You saved me, this is awesome. Thanks

@Mister-A
Copy link

A thousand thank yous! Finally a solution. I'll mop up the blood, sweat and tears and move on with my life.

@neofutur
Copy link

neofutur commented Nov 5, 2020

worked for me ! many thanks you saved my ass ! its a shame for java and dell we have to do all that to use their sh**ty products !

@raje2411
Copy link

Cool, this help me to access my Dell R620 from my Mac OS.

@almas
Copy link

almas commented Nov 24, 2020

Finally it is worked on Windows 10. Thank you very much guys :) Specially thank you to @j0mbie

@Yamakuzure
Copy link

Hey, thank you very much for your script.
It did not work for a DELL PowerEdge R715 out of the box, but I made it work with the following adaptation:

#!/bin/bash

echo -n 'Host: '
read drachost

echo -n 'Username: '
read dracuser

echo -n 'Password: '
read -s dracpwd
echo

JRE="$HOME/jre-7u79/jdk1.7.0_79/"

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

As you can see, the kmport and vport are 4900 on my server, not 5900. I got that information out of the jnlp file.

It complained about the native IO lib not working, but keyboard worked just fine despite that complaint.

@Gamer08YT
Copy link

Gamer08YT commented Dec 17, 2020

12/17/2020 02:28:18:947: User login response: 0
Failed to open video connection.
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at com.avocent.kvm.b.l.a(Unknown Source)
at com.avocent.kvm.b.l.b(Unknown Source)
at com.avocent.kvm.b.r.z(Unknown Source)
at com.avocent.kvm.b.n.a(Unknown Source)
at com.avocent.kvm.b.n.a(Unknown Source)
at com.avocent.kvm.b.y.run(Unknown Source)

Getting that by running the script :|

@PrestonHack
Copy link

12/17/2020 02:28:18:947: User login response: 0
Failed to open video connection.
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at com.avocent.kvm.b.l.a(Unknown Source)
at com.avocent.kvm.b.l.b(Unknown Source)
at com.avocent.kvm.b.r.z(Unknown Source)
at com.avocent.kvm.b.n.a(Unknown Source)
at com.avocent.kvm.b.n.a(Unknown Source)
at com.avocent.kvm.b.y.run(Unknown Source)

Getting that by running the script :|

It is refusing the connection, i'm sure you see that. There isn't much to gain from the error message. I would suggest checking your firewall settings. Or find out why that port if refusing the connection otherwise. It looks like a configuration issue not the software.

@Gamer08YT
Copy link

12/17/2020 02:28:18:947: User login response: 0
Failed to open video connection.
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at com.avocent.kvm.b.l.a(Unknown Source)
at com.avocent.kvm.b.l.b(Unknown Source)
at com.avocent.kvm.b.r.z(Unknown Source)
at com.avocent.kvm.b.n.a(Unknown Source)
at com.avocent.kvm.b.n.a(Unknown Source)
at com.avocent.kvm.b.y.run(Unknown Source)
Getting that by running the script :|

It is refusing the connection, i'm sure you see that. There isn't much to gain from the error message. I would suggest checking your firewall settings. Or find out why that port if refusing the connection otherwise. It looks like a configuration issue not the software.

I have no firewall between my pc and my server...

I used another script from GitHub, and it worked for me, don't know if it relies on my IDrac6 Version...

But thanks for your fast Answer 👍

@PrestonHack
Copy link

Post your version of Java to make sure you are using the right one and maybe someone else has an idea for you.

@Yamakuzure
Copy link

12/17/2020 02:28:18:947: User login response: 0
Failed to open video connection.
java.net.ConnectException: Connection refused: connect

I have no firewall between my pc and my server...

I had this, too, because my server listens on a different port. Got the correct one out of the jnlp file.

@Gamer08YT
Copy link

Thanks for your replies, i think the script has a section were the session between idrac and pc gets started.
I only copied the Java Command because I like to use the script without Input, i know it's not secure but it's only a trashy testserver :)

@lx1
Copy link

lx1 commented Dec 18, 2020

Hi!

I'd like to make a big Thanks!
The method works for me with an iDRAC7 on a T320. The only thing I had to change to make it work with iDRAC7 are the arguments passed to java.exe, which should be the ones listed in the lines in the .jnlp.
My command line for iDRAC7 is below. In particular, if I omit reconnect=2, the console stays in "Reconnecting..." state, then times out.

bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% vm=1 title=idrac-%2C+PowerEdge+T320%2C+User%3A+root user=%dracuser% passwd=%dracpwd% kmport=5900 vport=5900 apcp=1 reconnect=2 chat=1 F1=1 custom=0 scaling=15 minwinheight=100 minwinwidth=100 videoborder=0 version=2 "helpurl=https://%drachost%:443/help/contents.html"

@Durrok
Copy link

Durrok commented Feb 4, 2021

@j0mbie Thank you so much for writing that all out. Worked like a charm.

@patrickmrennie
Copy link

thanks for this, followed the instructions and worked perfectly on win10 64 latest.

@itzsimpl
Copy link

itzsimpl commented May 6, 2021

Thank you! Works like a charm.

Here is my batch file for windows 10 (64-bit, but easily changed for 32-bit)... it automatically downloads the jar files and unzips the .dll files if they don't exist so it can use the native dll libraries:

Also, keep in mind if you still have to update the java settings to allow the older TLS to work:
Java location .\jre\lib\security\java.security
Remove SSLv3 and 3DES_EDE_CBC from jdk.tls.disabledAlgorithms, should end up like so:
jdk.tls.disabledAlgorithms=RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40

@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

IF NOT EXIST "avctKVM.jar" (
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')"
)

IF NOT EXIST "lib" (
ECHO Creating lib directory
mkdir "lib"
)

IF NOT EXIST ".\lib\avmWinLib.dll" (
  IF NOT EXIST ".\lib\avctVMWin64.zip" (
    IF NOT EXIST ".\lib\avctVMWin64.jar" (
      ECHO Grabbing avctKVMWin64.jar from host...
      powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctVMWin64.jar','.\lib\avctVMWin64.jar')"
    )
    ECHO Renaming avctVMWin64.jar to avctVMWin64.zip
    rename ".\lib\avctVMWin64.jar" avctVMWin64.zip
  )
  ECHO Unzipping avctKVMWin64.zip
  powershell Expand-Archive ".\lib\avctVMWin64.zip" -DestinationPath ".\lib"
  rmdir ".\lib\META-INF" /s /q
  erase ".\lib\avctVMWin64.zip" /q
)

IF NOT EXIST ".\lib\avctKVMIO.dll" (
  IF NOT EXIST ".\lib\avctKVMIOWin64.zip" (
    IF NOT EXIST ".\lib\avctKVMIOWin64.jar" (
      ECHO Grabbing avctKVMIOWin64.jar from host...
      powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVMIOWin64.jar','.\lib\avctKVMIOWin64.jar')"
    )
    ECHO Renaming avctKVMIOWin64.jar to avctKVMIOWin64.zip
    rename ".\lib\avctKVMIOWin64.jar" avctKVMIOWin64.zip
  )
  ECHO Unzipping avctKVMIOWin64.zip
  powershell Expand-Archive ".\lib\avctKVMIOWin64.zip" -DestinationPath ".\lib"
  rmdir ".\lib\META-INF" /s /q
  erase ".\lib\avctKVMIOWin64.zip" /q
)

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"

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