Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Open Source

Running Windows And Linux On A Single System


Setting Up Audio on VMware Server

A VMware Server guest can handle multimedia content and access the PC audio system to provide sound. If you're running a 64-bit host and a Windows Vista 64-bit guest, you can use the 64-bit VMware Server driver on the VMware.com site. Download it, put it in the Windows filespace, and install it as you would any other audio driver.

Everyone else should do the following:

  1. Install this Windows sound driver as follows: Open Control Panel " Settings > System > Sound " Multimedia.

  2. Delete all audio drivers.

  3. Install the driver file.

  4. Reboot. Find the .cat file (or other config file) the system asks for. It's in the pile of files the driver installs. Click OK.

  5. Play an audio file.

  6. Change KDE Sound admin settings to "autodetect." Then tell it to release the sound system after two idle seconds.

File Access To/From Guest/Host Via Samba

Samba is a collection of programs that collectively provide file and print services for Windows clients, making it possible for them to "see" Linux (and other) file systems as networked drives.

The most useful thing about a VMware Server Windows/Linux installation is its ability to use Windows legacy and native Linux applications on the same files. To make this possible, a filespace visible to both Linux and the Windows guest at the same time is required.

For instance, on my workstation, the Linux system sees /home/alizard/win/* as a directory tree. The Windows guest sees that directory tree as networked Drive E.

This isn't a Samba guide, because there are many books and articles on that. But here's enough to give you a quick start and get you working.

First, make sure that Samba is installed on the system. It usually is by default, but check anyway.

In the following Samba configuration file, "Username" means your username. The user IDs should be the same for both Windows and your host. This configuration file basically defines the shared Linux-Windows environment.

For more information, go to the Samba man file:

$ man Samba
or go to the documentation at the Samba site linked to in the first paragraph of this section. Samba Configuration Setup for VMware Server Open a Linux text editor as root, and save the following into it:
/etc/Samba/smb.conf
( ; means comment line)
[global]
;General server settings
	netbios name = FC6
	workgroup = workgroup
	wins server = 169.0.0.1
	server string = Samba Server
	printcap name = /etc/printcap
	cups options = raw
	log file = /var/log/Samba/%m.log
	max log size = 50
	socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192
; SO_SNDBUF=8192
	dns proxy = no
	guest ok = yes
	guest account = username
	security = user
	encrypt passwords = yes
	username map = /etc/Samba/smbusers
 smb passwd file = /etc/Samba/smbpasswd
	restrict anonymous = no
	domain master = yes
	preferred master = yes
	max protocol = NT
	acl compatibility = winnt
	ldap ssl = No
	server signing = Auto

[win]
	path = /home/username/data/
	writeable = yes
	valid users = username
	comment = home
	admin users = username
	browseable = yes
        case sensitive = no

The "path" in the above configuration file should point at the Linux directory or directory tree that you want to be the shared Linux-Windows filespace.

When the new directory appears within the C: drive, right-click its icon in Properties and click "Map to network drive." (It will probably be drive E:) Once you've set up Samba on VMware Server, you may get this error message during startup: "Permanent connection not available. . . do you want to restore . . .?" If so, then click Yes. Next, check your shared folder / network drive from Network Neighborhood or Windows Explorer. If it worked to begin with, you should see the contents of the shared Linux/Windows directory right where you left them.

On a new installation, if you have a firewall installed, you'll know that Samba is up as soon as you see the following VMware ZoneAlarm alert:


As soon as you see that (assuming that it is in the "localhost" 192.x.x.x range), tell your firewall to permit NetBIOS access to that IP address. Open your firewall there, and you should see something like the following in Network Neighborhood:


Helpful SAMBA Hints

The following hints and tips will make the shared Linux / Windows filespace easier to use:

  • Make sure your Windows file tree hasn't changed from when you ran Windows in native mode. Put that file tree in a network drive created in Samba as described above. Move only those program files and data that can't be used by non-Windows applications onto the Windows virtual drive.

  • Because you don't have direct access to the virtual data files from Linux, to keep your data accessible by storing it in the Linux space and using a Network Drive/Samba to give Windows applications access.

  • On Windows Desktop shortcuts, right-click Properties on each icon, and change the drive letter from C: to E: on anything you didn't move into Windows but plan to keep using. Alternatively, simply do this every time you use another program from a Windows desktop icon.

Setting Up USB Devices (Printers, Scanners, etc.)

You can access a printer, scanner or other USB devices directly from Windows applications via VMware Server.

The following image shows the menu tree opened to where one selects specific USB devices for use with VMware Server. To select a device, click on the corresponding device menu entry. A checkmark will then appear on the menu next to selected the next time you open the menu:


To get to what you see here, from the VMware Server Console top menu: VM > Removable Devices > USB Controller > printer.

Here's how to get a USB printer working in VMware:

  1. Open VMware Server.
  2. Click the Windows tab.
  3. Click on Add Device.
  4. Add the USB controller.
  5. Boot Windows.
  6. From the VM toolbar, VM > Removable Devices > USB Devices > [your printer name].
  7. Windows should show "installing new devices" and then demand you select a printer or "Have Disk." Pop in the CD (usually) containing your printer drivers.
  8. Click OK. You should see a window showing files being installed.
  9. Go to Start > Settings > Printers. You should see your printer.
  10. Right-click the printer icon, and select Properties.
  11. Click "print test page." Watch a printer test page appear. Close it, and you're done.

You can also get scanners and other USB devices to work, as well, by following the non-printer-specific part of the above procedure. For example, I got a Belkin USB UPS working in VMware. (Later, however, I realized that the software was of no particular use on a Linux host!)

The VMware virtual USB adaptor lets you operate two active USB devices concurrently. To attach a second USB device, follow the "VMware Toolbar" step above. A USB device can be used either from the Linux host or Windows guest; you have to choose which OS the USB device is to work with, and then change as necessary.

Running a Printer from VMware Server

Disable the printer in Windows so it can be used in Linux by going to the VM > Removable Devices > printer menu item again. Then unplug/replug the printer's USB cable. Go to print manager, and stop/start the printer.

To switch USB printers between OSes, you may have to turn off the USB devices on VMware server, or even restart a device using unplug/plug. Then restart the CUPS Linux print system. Do this by going to the Linux Start Menu. Then open Control Center, click Peripherals > Printers, and click Printers from the top Printer menu. Finally, click Restart on the pulldown menu.

As for scanners, you might as well do this from Linux!

VMware Server occasionally drops Windows audio. If this happens, right-click the speaker icon on the bottom-right of the status bar of the VMware Server console. Then select Connect.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.