Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use some software under a VMWare VM that needs to access the parallel port. If the lp kernel module is loaded, VMWare's Player can't access the port. I need to unload the module every time I want to use it under my virtual machine, and since I never use it under Ubuntu itself, it'd be nice if it was just not loaded by default.

I've tried adding blacklist lp to /etc/modprobe.d/blacklist.conf and running sudo update-initramfs -k all -u, but lsmod shows that it's still loaded after I boot. How can I keep the module from being loaded? I'm using Ubuntu 11.10 with the 3.0.0-x kernels from the kernel team PPA.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

How can I keep the module from being loaded?

lp is built into the kernel, so blacklisting it won't work. The simple solution is to do rmmod lp to unload it once logged in. You can automate this by making an init script, or just putting this in your .bashrc -- use rmmod lp 2>nul so that if the module is already unloaded, it won't clutter your screen with an error.

I'm using Ubuntu 11.10 with the 3.0.0-x kernels from the kernel team PPA.

The long-term solution is to simply remove the module from the kernel, which of course requires building a custom kernel. Please see this community help page for more information on how to do this, if you choose to go this way.

share|improve this answer
    
I used to do it all the time, now... meh. –  detly May 9 '12 at 7:37
    
Build custom kernels. Back when various wireless protocols weren't built in, or USB bluetooth/IR/3G dongles needed arcane tweaking of settings. It shows how long it's been that I forgot you couldn't blacklist a built-in module, and didn't think to check for it :P –  detly May 9 '12 at 8:10
    
Unless VMWare needs access to the port upon bootup, an init script/upstart job should be sufficient. –  izx May 9 '12 at 8:12
add comment

building a custom kernel is not necessary

This is my procedure (legacy app, virtualized in vmware player, needing access to parallel port dongle)

in order for the parallel port dongle to work, the ubuntu user needs to be a member of the lp group. As root (or sudo):

vigr    (add user to group lp)
vigr -s (repeat)

Next, you need to prevent the kernel module lp from loading

Step 1 -- edit /etc/modules to ensure lp is not loaded at boot:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

#lp
rtc

Step 2 -- blacklist lp module (ubuntu 10 and later) to allow the player to have access to it.

Create a file: /etc/modprob.d/blacklist-vmware.conf

#/etc/modprob.d/blacklist-vmware.conf
blacklist lp

Step 3 -- execute the following to update boot image:

dpkg-reconfigure linux-image-$(uname -r)

Step 4 -- edit /etc/default/cups to look like this:

# Cups configure options

# LOAD_LP_MODULE: enable/disable to load "lp" parallel printer driver module
LOAD_LP_MODULE=no

reboot and test

lsmod | grep lp

(should be a null response)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.