Showing posts with label Workstation 7. Show all posts
Showing posts with label Workstation 7. Show all posts

Saturday, July 31, 2010

VMware Workstation, Ubuntu Host, Windows XP Guest: Automated Way to Map Network Drives

I was using Windows XP virtual machines (VMs) in VMware Workstation 7 on Ubuntu Linux.  I wanted to automate the process of mapping network drives.  I typically used the Map Network Drive technique in Windows Explorer for this purpose.  It appeared possible to automate this with a registry edit, but apparently a  more typical and robust approach was to use the "net use" command.

The net use command could be entered from the command line.  I was more interested in saving it in a batch file that I could apply to multiple network drives and could re-run anytime without having to remember or research the proper syntax.  Microsoft seemed to say that, for my purposes, the command to map a network drive would look something like this:

net use d: "\\vmware-host\Shared Folders\DATA" /persistent:yes
where DATA was the name that I had given to the drive in Ubuntu.  This resulted in an entry in Windows Explorer that read, "Data on 'vmware-host\Shared Folders' (D:)."  I was not able, at this point, to automate the process of right-clicking and renaming that to be simply "DATA."

I combined several of those commands in a batch file.  A batch file was just a file created in Notepad, with one command on each line.  I also included a comment, in case I wanted to write an "undo" batch file.  The line just shown, made permanent and accompanied by that comment, looked like this:
net use d: "\\vmware-host\Shared Folders\DATA" /persistent:yes
; to disconnect, use this (I think):  net use d: "\\vmware-host\Shared Folders\DATA" /delete
I saved that batch file in the folder containing my various WinXP installation materials.  So then, for future installations, all I had to do was to double-click on that batch file in Windows Explorer, or start it from the command line or from another batch file, and my drive mapping would proceed automatically.

Sunday, June 13, 2010

IrfanView Error: Windows Can't Play This File

I was using Windows XP SP3 as the guest operating system in a VMware Workstation 7 virtual machine (VM) on Ubuntu 10.04 (Lucid Lynx).  For some months, I had been using IrfanView to play various audio and sometimes video files in that VM.  Suddenly, with a number of files, I started getting this error message:

IrfanView
Error:  Windows can't play this file!
Windows error text:  The specified file cannot be played on the specified MCI device.  The file may be corrupt, not in the correct format, or no file handler available for this format.
You can try to install additional video/audio codecs from this site:
http://www.fourcc.org/indexcod.htm
or try the DirectShow option in 'Properties->Video'
At first I thought this was a problem with IrfanView.  I upgraded to the most current version of IrfanView and tried again.  The error was still there.  I tried playing the file in Windows Media Player (WMP).  I got this message:
The file you are attempting to play has an extension (.wav) that does not match the file format. Playing the file may result in unexpected behavior.
Do you want the Player to try to play this content?
I said Yes.  It took a few seconds, but then it was able to play the file.  So yes, IrfanView was not handling it as well as WMP, but both of them were telling me there was a problem with the file.  And then I knew what the problem was.  I had bulk-renamed a bunch of files, and had inadvertently named some *.wma files to be *.wav files instead.  I renamed this file to be filename.wma instead of filename.wav.  Now IrfanView was able to play it without a problem.

I was surprised to encounter this problem.  IrfanView had an "Ask to rename if incorrect extension" option, and I had enabled it.  That option had often asked me if I wanted to rename a file that had somehow acquired an incorrect extension.  Why not this time?  Apparently IrfanView was not able to detect the problem in this particular scenario.  I checked what codecs I had been installing.  I was not too sure what codecs were all about, and for some years I had been using K-Lite Codec Packs as a sort of all-purpose Band-Aid.  But as I checked on it, it appeared that I had just been reinstalling the same old copy of version 3.5.9 or possibly 4.7.0, whereas K-Lite was now up to version 6.0.4.  So I downloaded and installed the latest 32-bit K-Lite Mega Codec Pack.  It was a big honker -- 25MB -- but my understanding was that, if somebody sent me a file of a Mongolian shepherd beating on a bucket and recording it on a 1960-era IBM tape drive, this would be all I would need to enable Windows to play it in five-channel glory with four-part harmony.

Wednesday, February 10, 2010

Ubuntu 9.10, VMware Workstation 7: Failed to Open Sound Device (Workaround)

In previous posts, I tried fixing error messages that I was getting in a Windows XP virtual machine (VM) running on VMware Workstation 6.5.2 on Ubuntu Linux, version 9.04.  I didn't know, at that time, whether some of my problems stemmed from having done an upgrade rather than a clean install of Ubuntu.  Now I found myself facing the same problem again, after a clean install of both Ubuntu 9.10 (Jaunty Jackalope) and VMware Workstation 7.

The problem was as follows:  if I checked the "Connect at power on" option, then audio would not run in the VM until (in full screen mode) I went into VM > Removable Devices > Sound Card > Connect; but when I did that, I would get this error message:

Failed to open sound device /dev/audio: Device or resource busy.  Failed to connect virtual device sound.

One recent discussion seemed to suggest that the problem was that Flash Player and/or Alsa audio.  I suspended my VMs and rebooted the computer.  When it rebooted, I made sure that Firefox was not running.  I resumed the VM and audio played OK in IrfanView.  I started Firefox inside the VM (i.e., in Windows XP) and played a YouTube video.  The audio was still OK in IrfanView.  I started a second session of Workstation and resumed a different VM in that session.  The manual sound card connection went OK; and there, too, I could play audio without stuttering.  The audio in the second VM was not as good; it had some static.

With those two VMs open, I started Firefox in Ubuntu (i.e., not in a WinXP VM).  I played another YouTube video.  Now I got an error message, and audio would not play in IrfanView within the VM.  I tried the other VM; same thing.  The error message was "Failed to open sound device /dev/audio: Device or resource busy.  Sound will be disconnected."  I went back to Ubuntu and killed Firefox.  Now I was able to connect the sound card and play audio inside the two VMs, same as before, complete with mini-stutters in the second one.  I started Firefox again in Ubuntu.  The audio was still OK inside the VM.  If I was playing audio in IrfanView in the VM and then went into a YouTube page in Firefox, the audio would not play in the latter.  I had to restart Firefox to get its YouTube audio to play, and then, as before, I was not able to hear audio inside the VM.  It worked the same way if I played a YouTube video in Opera rather than in Firefox.  So it seemed that the problem (which has apparently been around for years) continued to be within VMware Workstation.

For the time being, the solution seems to be either (a) to watch videos and other webpages that use Flash, do it in a browser session that is running inside your VM, not in a browser running in Ubuntu, or (b) after watching a video or otherwise using Flash in Ubuntu, kill the program that used it (e.g., Firefox) and manually reconnect with your sound card inside the VM.