LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Virtual Box + Printer Help!!!! (https://www.linuxquestions.org/questions/slackware-14/virtual-box-printer-help-623744/)

BULPulse 03-22-2008 11:05 AM

Quote:

Originally Posted by T3slider (Post 3096539)
You probably should be using the generic-smp kernel, as the huge-smp kernel is really meant just for the installation. You can use the huge-smp kernel with no ill effects, but it requires a lot of blacklisting of modules to avoid errors and tricky behaviour (which may be difficult to track down). You should think about switching to the generic-smp kernel (which requires an initrd!!) at some point (soon would be better). I would definitely suggest leaving an entry in /etc/lilo.conf for the huge-smp kernel though -- because of the requirement for an initrd, if you screw anything up (or if something gets screwed up with future kernels that you may decide to compile or upgrade etc.) the huge-smp will ALWAYS boot properly (it's very handy). To switch to the generic kernel, add an entry in /etc/lilo.conf that will boot that. The lilo entries for the generic-smp and huge-smp kernels can be done as follows:
Code:

image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Generic Kernel
  read-only

image = /boot/vmlinuz-huge-smp-2.6.21.5-smp
  root = /dev/sda1
  label = Huge Kernel
  read-only

NOTE: change /dev/sda1 in each of the above entries to wherever your hard drive is (use the existing huge-smp entry as an example). Note that in a default setup, /boot/vmlinuz is a symbolic link to /boot/vmlinuz-huge-smp-2.6.21.5-smp, so the lilo entry points to that instead of what I wrote above. You could always just symlink /boot/vmlinuz to point to the generic-smp kernel instead and avoid adding an entry, but then you don't have the backup huge kernel, which is very handy in an emergency.

After you edit /etc/lilo.conf (and BEFORE you run lilo), you must create an initrd (initial ramdisk). Read '/boot/README.initrd' (which is a symlink to /usr/doc/mkinitrd-1.1.2/README.initrd) and it'll tell you how to make an initrd (since I use reiserfs, I simply typed `mkinitrd -c -k 2.6.21.5-smp -m reiserfs` as root). That should create a /boot/initrd-tree directory and a /boot/initrd.gz file. You should also symlink System.map to point to System.map-generic-smp-2.6.21.5-smp instead of System.map-huge-smp-2.6.21.5-smp, but it's not essential (I've had mismatched System.map symlinks before because I forgot to change the symlink and had no problems whatsoever -- however, for correctness, it should be done).

After all that's done, run `/sbin/lilo` as root to update your MBR. Then you can happily reboot into the generic kernel. If anything goes wrong, you can simply boot using the huge kernel (that you hopefully created a lilo entry for) and your system will be back up and running with no ill effects, allowing you to remedy the error you may have made using the generic kernel.

Good luck.

Well I followed the instructions but now i can't use any linux kernel. What happens is:

When I try to run the generic it starts to load and after a while shows this:
Code:

Mounting /dev/sda3 failed
ERROR: No /sbin/init found on rootdev (or not mounted).
Kernel panic - not syncing: Attempted to kill init!

And for the huge kernel:
Code:

Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init = option to kernel

and i made lilo.conf back up just in case but i don't know if it will help

BULPulse 03-22-2008 12:43 PM

I managed to edit lilo.conf so i am back to normal but sill don't understand why it gave the errors shown in the previous post. Any suggestions how to fix it so i can use the generic kernel?

T3slider 03-23-2008 09:31 PM

For the generic kernel, that error looks like your initrd was incorrect. Post your attempted lilo.conf and the command you used to create the initrd. As for the huge kernel error, that's an odd one and I don't know how to explain it. Once again, post your lilo.conf file here. It would also be helpful if you posted the output of `mount` so we know that the naming of your hard drive is consistent with your lilo.conf file (I'm not calling you an idiot, just trying to get all of the info just in case you or I missed something in the setup). You may also wish to search the forums about creating an initrd to get a better guide than mine.

BULPulse 03-24-2008 09:59 AM

Quote:

Originally Posted by T3slider (Post 3098250)
For the generic kernel, that error looks like your initrd was incorrect. Post your attempted lilo.conf and the command you used to create the initrd. As for the huge kernel error, that's an odd one and I don't know how to explain it. Once again, post your lilo.conf file here. It would also be helpful if you posted the output of `mount` so we know that the naming of your hard drive is consistent with your lilo.conf file (I'm not calling you an idiot, just trying to get all of the info just in case you or I missed something in the setup). You may also wish to search the forums about creating an initrd to get a better guide than mine.

The lilo.conf I used when I got the errors was:
Code:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot="/dev/sda"
prompt
timeout="1200"
# Override dangerous defaults that rewrite the partition table:
change-rules
  reset
# Normal VGA console
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
map = /boot/map-bmp
bitmap = /boot/phrag-slack.blk.orb.bmp
bmp-colors = 15,,0;5,,15
bmp-table = 59,5,1,18,
bmp-timer= 66,28,6,8,0
# End LILO global section
# Windows bootable partition config begins
default=Slackware

other = /dev/sda2
        label="Windows"
  table = /dev/sda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
  initrd = /boot/initrd.gz
  root = /dev/sda3
  label = Slackware
  read-only

image = /boot/vmlinuz-huge-smp-2.6.21.5-smp
  root = /dev/sda3
  label = Huge
  read-only
# Linux bootable partition config ends

mount
Code:

/dev/sda3 on / type ext2 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda2 on /fat-c type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
/dev/sdb1 on /fat-s type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)

and the command i used for the initrd was:
Code:

mkinitrd -c -k 2.6.21.5-smp -m reiserfs

T3slider 03-24-2008 10:16 PM

Your problem is your `mkinitrd` command. You set it up to load the reiserfs module, but according to `mount` your / partition is ext2-formatted. Your command should be (I think) `mkinitrd -c -k 2.6.21.5-smp -m ext2`. If that doesn't work you may have to specify the / partition (although you shouldn't have to if you're already booted into your system, regardless of the kernel). To do that, try this: `mkinitrd -c -k 2.6.21.5-smp -m ext2 -f ext2 -r /dev/sda3`. Be sure to delete /boot/initrd.gz and /boot/initrd-tree before creating a new initrd (`rm /boot/initrd.gz` and `rm -rf /boot/initrd-tree` as root should do the trick).

Also, before creating the initrd you should make sure that the following packages are installed:
kernel-generic-smp-2.6.21.5_smp-i686-2.tgz
kernel-modules-smp-2.6.21.5_smp-i686-2.tgz
kernel-huge-smp-2.6.21.5_smp-i686-2.tgz
mkinitrd-1.1.2-i486-3.tgz

If the packages are installed, they should have an entry in /var/log/packages (type `ls /var/log/packages | grep kernel-generic-smp-2.6.21.5_smp-i686-2` [WITHOUT the .tgz] -- if you receive a result, it's installed. If not, it's not. Do the same for the other packages).

As for your huge kernel not working when you edited lilo.conf, just to make sure everything works I would keep the current, working lilo entry the same and just add the new generic entry. That way, your huge kernel should still work because you haven't changed it.

REMEMBER to run /sbin/lilo as root to update your MBR BEFORE rebooting into the new kernel.

NOTE: This whole time I have assumed you are using the smp kernel and not the uniprocessor, non-smp kernel. To check, type `uname -r`. It should say something about smp. If it doesn't, then report back and I'll fix my above instructions. I'm really making this sound 100 times harder than it is (it all takes under a minute to do once you know what you're doing), so sorry if my explanation is poor.

Good luck.

BULPulse 03-25-2008 04:42 PM

It is all working now :) I didn't have mkinitrd-1.1.2-i486-3.tgz installed so after installing it i run the command and everything working :) It is just that I don't see any difference. Well anyway the first thing I do when i have some spare time is compiling new kernel and KDE:). At least now I feel safe If I get it wrong. You have been great help!!! Thank you

T3slider 03-26-2008 09:49 PM

As far as I know the only place you'll REALLY notice a difference, if at all, is during bootup. A custom kernel may run faster than the huge kernel because fewer modules are loaded, but it won't run any faster than the generic kernel (because the same modules will be loaded -- although they may be compiled into the kernel itself, they're still taking up the same amount of memory). Basically a custom kernel may shorten bootup time (plus it may improve hardware interfacing if you use a newer version). I usually stick with the original kernel until a newer release comes out (however, a new kernel release is usually out before I can download the ISOs. ;)).

giusepped 03-11-2009 08:54 PM

Quote:

Originally Posted by T3slider (Post 3090513)
I successfully got my (Lexmark) USB printer working in Windows 2000 running in VirtualBox. Nifty, now it's no longer a complete paperweight. ;)

I had to add the following line to my /etc/fstab:
Code:

none            /proc/bus/usb    usbfs      devgid=106,devmode=664 0 0
devgid=106 corresponds to the group "vboxusers" (which I think was automatically created by VirtualBox), and therefore only users in that group can print. You can of course create a new group (called "usbusers" or some such thing, or use the plugdev group) and use that (any group containing your user will do, but make sure it excludes users you don't want printing from VirtualBox). To find the group id, check the number beside the appropriate group in /etc/group. MAKE SURE to change this value to the appropriate one, since the group ids in your system will be different than mine.

Before I did this, my printer was listed if I right-clicked on the USB icon in the statusbar in VirtualBox, but was grayed out. Now, it's actually clickable. I installed the printer using the Lexmark drivers (though you should use whatever drivers you would use on Windows appropriate for your printer) and it works perfectly. Unfortunately for me I had to replace the ink cartridges because I had left the (unusable) printer dormant ever since installing Linux and they had dried up, but it is now working nonetheless. The "Add Hardware Wizard" couldn't find the appropriate drivers (because Lexmark ships their drivers separately) and I couldn't find the CD, so I just downloaded them from their website -- you should be able to do the same for any printer brand.

Note that before you boot into VirtualBox you may have to add the USB printer's info in the USB Settings dialog (while the guest OS is NOT running) -- you can get that info from running `VBoxManage list usbhost` (as root?).

If you need more help (or a better explanation) just ask.

I followed your steps, but still I can't see the USB printer clickable in my machine. I can select it before running the Virtual Machine, but when it is started I cannot use it (it is in gray).
Any suggestion?
G


All times are GMT -5. The time now is 12:40 AM.