VMware

VMware Workstation 5.5

Features | Documentation | Knowledge Base | Discussion Forums

previous Prev   Contents   Last   Next next

Configuring a Parallel Port on a Linux Host

For the parallel port to work properly in a guest, it must first be configured properly on the host. Most issues involving parallel port functionality are a result of the host configuration. Check these areas of concern: the version of your Linux kernel, your device access permissions and the required modules.

Parallel Ports and Linux 2.2.x Kernels

The 2.2.x kernels that support parallel ports use the parport, parport_pc and vmppuser modules. Be sure that PC Style Hardware (CONFIG_PARPORT_PC) is loaded as a module, as mentioned at the beginning of Using Parallel Ports. The vmppuser module is supplied by VMware Workstation to give virtual machines user-level access to the parallel port.

To see if these modules are installed and running on your system, run the lsmod command as the root user. These three modules should be included in the listing of running modules. You can also look at the /proc/modules file for the same list.

To load the proper modules, run this command:

insmod -k <modulename>

If none of the listed parallel port modules is running, use this command:

insmod -k parport_pc

This command inserts the three modules needed for a parallel port.

If you continue to see problems, it is possible that the lp module is running. If it is, the virtual machine cannot use the parallel port correctly. To remove the lp module, run this command as the root user:

rmmod lp

You should also ensure that the line referring to the lp module in the /etc/modules.conf or /etc/conf.modules file is removed or commented out by inserting a hash character (#) at the beginning of the line. The name of the configuration file depends on the Linux distribution you are using. When you reboot the host after removing this line, the configuration file no longer starts the lp module.

To ensure that the proper modules for the parallel port are loaded at boot time, add this line to the /etc/modules.conf or /etc/conf.modules file:

alias parport_lowlevel parport_pc

Parallel Ports and Linux 2.4.x Kernels

Be sure that PC Style Hardware (CONFIG_PARPORT_PC) is loaded as a module as mentioned at the beginning of Using Parallel Ports. If you are using a 2.4.x kernel, the modules that provide parallel port functionality are parport, parport_pc and ppdev.

To see if these modules are installed and running on your system, run the lsmod command as the root user. These three modules should be included in the listing of running modules. You can also look at the /proc/modules file for the same list.

To load the proper modules, run this command:

insmod -k <modulename>

If none of the listed parallel port modules is running, use this command:

insmod -k parport_pc

This command inserts the three modules needed for a parallel port.

If you continue to see problems, it is possible that the lp module is running. If it is, the virtual machine cannot use the parallel port correctly. To remove the lp module, run this command as the root user:

rmmod lp

You should also ensure that the line referring to the lp module in the /etc/modules.conf or /etc/conf.modules file is removed or commented out by inserting a hash character (#) at the beginning of the line. The name of the configuration file depends on the Linux distribution you are using. When you reboot the host after removing this line, the configuration file no longer starts the lp module.

To ensure that the proper modules for the parallel port are loaded at boot time, add this line to the /etc/modules.conf or /etc/conf.modules file:

alias parport_lowlevel parport_pc

Linux kernels in the 2.4.x series also use a special arbitrator that allows access to the parallel port hardware. If the parallel port is in use by the host, the guest cannot use it. If a virtual machine is using the parallel port, the host and any users accessing the host are not given access to the device. VMware Workstation puts a lock on the device, and this lock restricts access so only the virtual machine can use the port.

You can choose VM > Removable Devices to disconnect the parallel port from the virtual machine and reconnect it.

Parallel Ports and Linux 2.6.x Kernels

Be sure that PC Style Hardware (CONFIG_PARPORT_PC) is loaded as a module as mentioned at the beginning of Using Parallel Ports. If you are using a 2.6.x kernel, the modules that provide parallel port functionality are modprobe <modulename> and modprobe parport_pc.

To see if these modules are installed and running on your system, run the lsmod command as the root user. You can also look at the /proc/modules file for the same list.

With 2.6.x, loading parport_pc does not load all three modules. If none of the listed parallel port modules is running, use this command:

modprobe parport_pc && modprobe ppdev

This command inserts the three modules needed for a parallel port.

If you continue to see problems, it is possible that the lp module is running. If it is, the virtual machine cannot use the parallel port correctly. To remove the lp module, run this command as the root user:

rmmod lp

You should also ensure that the line referring to the lp module in the /etc/modules.conf or /etc/conf.modules file is removed or commented out by inserting a hash character (#) at the beginning of the line. The name of the configuration file depends on the Linux distribution you are using. When you reboot the host after removing this line, the configuration file no longer starts the lp module.

To ensure that the proper modules for the parallel port are loaded at boot time, add this line to the /etc/modules.conf or /etc/conf.modules file:

alias parport_lowlevel parport_pc

Linux kernels in the 2.6.x series also use a special arbitrator that allows access to the parallel port hardware. If the parallel port is in use by the host, the guest cannot use it. If a virtual machine is using the parallel port, the host and any users accessing the host are not given access to the device. VMware Workstation puts a lock on the device, and this lock restricts access so only the virtual machine can use the port.

You can choose VM > Removable Devices to disconnect the parallel port from the virtual machine and reconnect it.

Device Permissions

Some Linux distributions by default do not grant the virtual machine access to the lp and parport devices. In most of these cases, the owner of the device is root and the associated group is lp. To allow the VMware user to access the device, add the user to the associated group. To view the owner and group of the device, run this command:

ls -la /dev/parport0

The third and fourth columns of the output show the owner and group, respectively.

To add the user to the device group, edit the /etc/group file. On the line starting with lp, which defines the lp group, add the VMware Workstation user's user name. You must make this change as the root user. The following line provides an example for a user whose user name is userj.

lp::7:daemon,lp,userj

The next time the user logs on to the host, the changes take effect.

previous Prev   Contents   Last   Next next