PTY allocation request failed on channel 0

Recently I tried to ssh into a guest in vmware. I was able to authenticate in the server and I was not able to access the console. I was getting the following error.

$ ssh x.x.x.x
The authenticity of host ‘x.x.x.x (x.x.x.x)’ can’t be established.
RSA key fingerprint is 1c:4d:1b:6g:d5:40:db:5b:46:7f:bb:17:b1:1b:41:80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘x.x.x.x’ (RSA) to the list of known hosts.
root@x.x.x.x’s password:
PTY allocation request failed on channel 0

On checking the logs from the console, I found the following error.

sshd[2641]: pam_unix(sshd:session): session opened for user root by (uid=0)
sshd[2641]: error: openpty: No such file or directory
sshd[2641]: error: session_pty_req: session 0 alloc failed
sshd[2756]: pam_unix(sshd:session): session opened for user root by (uid=0)
sshd[2756]: error: openpty: No such file or directory
sshd[2756]: error: session_pty_req: session 0 alloc failed

I found that the device file ptmx was missing the server. Now I have to recreate the device file. I googled around for sometime and found the following solution.

$ sbin/MAKEDEV -d /dev ptmx

And it worked. I restarted SSH service and was able to login to the vmware guest. 🙂

Running VmWare vSphere client on Windows

When attempting to run the vmware vsphere client the following errors are received and is unable to login or proceed any further:

“Error parsing the server “<server name” “clients.xml” file.”

“The type initializer for ‘VirtualInfrastructure.Utils.HttpWebRequestProxy’ threw an exception.”

Follow the following easy steps and you will be ready to go.

Download this DLL called system.dll

Once downloaded install it in the “C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib” directory. If the ‘lib’ directory doesn’t exist then create it and drop the dll file into it.

Next edit the “VpxClient.exe.config” file which can be found in the “C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher” directory and add the following three lines to it before the last line. Then save the changes.

<runtime>
<developmentMode developerInstallation=”true”/>
</runtime>

The file after the changes will look like below:

<?xml version=”1.0″ encoding=”utf-8″?>
<configuration>
<system.net>
<connectionManagement>
<clear/>
<add address=”*” maxconnection=”8″ />
</connectionManagement>
</system.net>
<appSettings>
<add key = “protocolports” value = “https:443″/>
</appSettings>
<runtime>
<developmentMode developerInstallation=”true”/>
</runtime>
</configuration>

From the Windows ‘System Properties’ click the ‘Advanced’ tab and then the ‘Environment Variables’ button as we want to add a new ‘System’ variable.

Create a new ‘System’ variable called ‘DEVPATH’ and assign the following variable value, or as a User variable if you are running the vsphere client as an user.

C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib

You are now ready to start using the VMware vSphere Client on your Windows machine.

To Install VMware Tools in a Linux Guest

To Install VMware Tools in a Linux Guest, do the following steps,

Goto, Settings > VMware Tools Install and click Install.

This step connects the virtual machine’s CD-ROM drive to an ISO image file on the ESX Server machine.

In your Linux guest, become root, mount the VMware Tools virtual CD-ROM, copy the installer file from the virtual CD-ROM to installation directory, and unmount the CD-ROM.

mount -t iso9660 /dev/cdrom /mnt
cp /mnt/vmware-linux-tools.tar.gz /usr/src
umount /dev/cdrom

Untar the VMware Tools tar file in /tmp and install it.
cd /usr/src
tar zxf vmware-linux-tools.tar.gz
cd vmware-tools-distrib
./vmware-install.pl

Choose directories for the files. Enter a display size for the virtual machine and press Enter. Follow the instructions in the screen. Start X and your graphical environment and launch the VMware Tools background application.

vmware-toolbox &

Note: If you created this virtual machine using the vmxnet driver, run netconfig or another network configuration utility in the virtual machine to set up the virtual network adapter.