Openbox - mount usb sticks

Post here if you are a new Porteus member and you're looking for some help.
User avatar
bshogeman
White ninja
White ninja
Posts: 27
Joined: 10 May 2013, 13:12
Distribution: Porteus 2.0 x64
Location: Lisse, the Netherlands
Contact:

Openbox - mount usb sticks

Post#1 by bshogeman » 24 May 2013, 12:06

I created /home/guest/.dmrc
With contents: Session=openbox-session

Porteus boots now in openbox as default.
In LXDE and XFCE usb sticks are mounted by default in /run/media/guest
Now with openbox as default session manager this doesn't work anymore.

How can I fix this?

Is the executable wrong that I used by session?

Other options that I found:
/usr/libexec/openbox-autostart
/usr/libexec/openbox-xdg-autostart

I also compared the processlist (ps)
/usr/libexec/openbox-autostart
/usr/libexec/openbox-xdg-autostart
/usr/libexec/udisks-daemon
/usr/libexec/upowerd
/usr/libexec/gvfsd
tumblerd
xfcs4-power-man
xfcs4-notifyd
gvfs-udisk2-volume-monitor
pcmanfm
dbus-launch

Something here that I must load extra? If so, where? Must it be loaded as root or guest?

/etc/udev/rules.d/automount.rules or something alike does not exist. Maybe that is the whole problem?
If so and this file must exist. Where is it created? What can be wrong or better what must I fix for this?

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Openbox - mount usb sticks

Post#2 by Ahau » 24 May 2013, 21:24

I tried to recreate this on my end and am having a hard time. Based on your post, it sounds like you have the xfce, lxde, and razor modules all activated at the same time, and you're using gdm (out of the razor module) to boot into openbox. Is that correct? I'm not familar with gdm and have never used .dmrc -- when I tried, it still booted me into razor and erased the contents of ~/.dmrc!

I think it'd be best to start out by eliminating some of the variables and simplifying your setup so we can easily find the culprit. For the time being, I would move xfce and razor into /porteus/optional so they stay out of the picture. Then, modify the lxdm configuration file so that lxdm will run openbox instead of lxde.

edit /etc/lxdm/lxdm.conf and replace the line (or something like it)

Code: Select all

#session=/usr/bin/startlxde
with

Code: Select all

session=/usr/bin/openbox-session
Then, copy lxdm.conf into your rootcopy, e.g., as root:

Code: Select all

mkdir -p /mnt/sdb2/porteus/rootcopy/etc/lxdm && cp /etc/lxdm/lxdm.conf /mnt/sdb2/porteus/rootcopy/etc/lxdm/lxdm.conf
, where "sdb2/porteus/" is the device and path to your porteus data.

Now, boot without your saved changes (one more variable to remove) and use the 'lxde' cheatcode to ensure lxdm is selected as the login manager. That should load openbox for you. If automounting isn't working there, let me know and I'll do some further testing (it's working for me this way, but I'm running a preliminary version of Porteus 2.1). If it is working, we can start adding things back one at a time to see where the problem lies.

Off the top of my head, I'm wondering if perhaps your openbox session isn't getting started inside a proper dbus and/or consolekit session. If so, it could be related to your xinitrc.openbox-session file, gdm not handling things well, or something entirely different.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
bshogeman
White ninja
White ninja
Posts: 27
Joined: 10 May 2013, 13:12
Distribution: Porteus 2.0 x64
Location: Lisse, the Netherlands
Contact:

Re: Openbox - mount usb sticks

Post#3 by bshogeman » 25 May 2013, 13:15

Recreating my situation is easy..

Take the Porteus-XFCE-v2.0-x86_64.iso and add 003-lxde.xzm from the Porteus-v2.0-x86_64.iso now remove 005-devel.xzm and 006-firefox.xzm from this installation.
You now have a basic version of the porteus version I use. I added some modules for freerdp 1.0.2.

Why combining the LXDE and XFCE version? Because the Porteus-v2.0-x86_64.iso contain KDE, LXDE and Openbox. I don't like KDE and LXDE have some of the looks of it. So I wanted Openbox and XFCE as Desktop manager.
Why Openbox.. Because the purpose of the new image was that it will run as thinclient. Only for management purposes I wanted XFCE to be present. XFCE feel much more as the old GNOME (now MATE) but not so heavy.
But you are right.. I can better choice LXDE and live with it. That version has Openbox and that is what I really want.
I didn't use the rootcopy folder but scripted it with a .sh file that is started from a kernel parameter AUTOEXEC=
Because I embedded all the xfm files in the initrd so I can use it for network boot (diskless workstations) and didn't want to rebuild the image every time the changes existed outside of the image. The kernel command was wat made it happen.

But back to the automounting of usb devices.. If you want to recreate this problem you don't have to rebuild my situation. The problem also exist in the default Porteus-v2.0-x86_64.iso image if you boot in LXDE, logoff, choose Openbox as WM and put a usb disk in your pc. If you now look at the terminal there can't be found a mounted usb stick anywhere. /run/media/guest does not exits and there isn't a new volume on /media either. I searched the whole filesystem for a file that I knew was on the stick but could not find it. It really wasn't mounted.

But I will now rebuild the initrd with files from the Porteus-v2.0-x86_64.iso and use the rootcopy folder for the changes. I will let you know if it works :) But if not.. Is there already a public alpha/beta of Porteus 2.1 on its way? :D

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Openbox - mount usb sticks

Post#4 by Ahau » 25 May 2013, 16:20

Short on time this morning so I haven't been able to test in 2.0 yet, but will tonight, and report back with my findings.

I wasn't trying to get you to change your production setup (I happen to like xfce myself!), just trying to narrow the cause of the problem while testing so we could find it and resolve it for all setups. Thanks for your helpful information on how to reproduce it!

I'd say we're less than two weeks away from a public release of 2.1 RC1, assuming all goes as planned :)
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
bshogeman
White ninja
White ninja
Posts: 27
Joined: 10 May 2013, 13:12
Distribution: Porteus 2.0 x64
Location: Lisse, the Netherlands
Contact:

[Solved] Openbox - mount usb sticks

Post#5 by bshogeman » 25 May 2013, 18:59

Sorry it didn't help.
For some reason the file /mnt/live/mnt/embedded/porteus/rootcopy/etc/lxdm/lxdm.conf wasn't copied by default or overridden by an other process. The default shell was there again.
I solved this by adding: autoexec=cp~/mnt/live/mnt/embedded/porteus/rootcopy/etc/lxdm/lxdm.conf~/etc/lxdm/ to the kernel parameters. So it booted in Openbox.
But automounting the usb stick still doesn't work :(

Changing the product isn't that much of work. It only becomes better every time. This time the image is smaller which is better for the users. And I use more features Porteus has in it by default. To rebuild the environment I still use XFCE :)

The strrange thing I see is that if in LXDE the processlist contains: openbox --config-file /home/guest/.config/openbox/lxde-rc.xml
And if Openbox is loaded as WM than this process isn't active but: /usr/bin/openbox --startup /usr/libexec/openbox-autostart OPENBOX is (both loaded as guest)
Process that I am also missing is: /usr/lib/udisk2/udisksd --no-debug and
/usr/bin/dbus-launch --sh-syntax --exit-with-session xfce4-session
/usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
Maybe the first of these had been launched as openbox-session instead of xfce4-session?
Both these processes exist in lxde to. Only then there is no parameter after --exit-with-session on the first dbus command.


I have found a quick and dirty solution.
I don't use Openbox but load lxde instead. Then I run lxpanelctl exit and pcmanfm --desktop-off
Auto mount is working. I only have to get rid of the popup.
Solution found for that too: /home/guest/.config/pcmanfm/pcmanfm.conf and turn autorun to 0.

I have a solution. Not tested it yet. The solution for openbox isn't that important anymore.
You say that it works in 2.1 RC1 and that is only 2 weeks way from now. Can't wait to try it ;)

Next.. try to understand how the polkit works and how i can make an exception to allow guest to run dmidecode :)
But first I build and check the quick and dirty solution above...

Hm that wasn't the right combination.. But found it..
Don't use pcmanfm --desktop-off automount doesn't work anymore after this command :) Empty the /home/guest/Desktop folder instead. And wait (sleep) 2 seconds before executing lxpanelctrl exit else it isn't started yet so can't exit yet.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Openbox - mount usb sticks

Post#6 by Ahau » 29 May 2013, 05:11

I tested in 2.0, and I'm able to automount usb flash drives in pcmanfm in openbox, after logging in to lxde, then out to lxdm, and back in to openbox. Please try this again without saved changes or additional modules, and check dmesg to make sure the kernel is registering the drive being plugged in, and run 'udisks --monitor' in a terminal to see if udisks registers the device being plugged in. Please post the output here. I'm guessing the kernel will see it and udisks won't, but I'm not sure where to go if that's the case.
Please take a look at our online documentation, here. Suggestions are welcome!

Post Reply