You are not logged in.

#1 2012-03-19 12:10:03

sms
Member
Registered: 2012-03-19
Posts: 4

[SOLVED] Going back to X from console.

I have two accounts on my system: sms and sms-windows. If I log in as sms, bash_profile will run xinitrc with gnome-session launcher and if I log in as sms-windows, it will run this:

if [...]
fi

exec ck-launch-session xmonad &
VBoxSDL --fullscreen --startvm Home-7OEM

It will launch single, maximilised window with virtualised Windows system.

It's working but I want to log in as sms at tty1 and as sms-windows at tty2 in order to change the workplace from Linux to Windows and back to Linux again... but ctrl+alt+f1/f2 switching will turn my X session down and leave me within command line.

What should I do to enable such a switching I desire?

Last edited by sms (2012-03-19 14:02:39)

Offline

#2 2012-03-19 12:18:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,652
Website

Re: [SOLVED] Going back to X from console.

The most direct answer is that your x sessions are on tty7 and tty8 (if a second one successfully launched).  From a console, hit Alt-F7 or Alt-F8.

Less direct however: why do you want to separate x sessions running to switch between arch and windows when one of those is just a single workspace with win-in-vbox?  Why not run virtualbox in a workspace on the session you prefer?  You can then switch between them with workspace switching within your WM.

I'm also not sure why xmonad was chosen.  I love xmonad and use it almost exclusively, but just to be a wrapper for a virtualbox it seems a pretty drastic overkill.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-03-19 12:24:44

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: [SOLVED] Going back to X from console.

edit: I agree with Trilby on this, however I made a few suggestions anyway.

I'm making the assumption you wish to automatically login on both tty1 (as gnome) and tty2 (as windows)?

If you don't want to autologin, then this first suggestion is not needed:

#/etc/inittab
[...]
c1:2345:respawn:/sbin/agetty -a sms -8 -s 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -a sms-windows -8 -s 38400 tty2 linux
[...]

Then edit your bash{_profile,rc} for sms-windows:

#/home/sms-windows/.bashrc

if [[ ! $DISPLAY && $(tty) = /dev/tty1 ]]; then
    xinit -nolisten tcp ~/.xinitrc #X Init script containing VBoxSDL --fullscreen --startvm Home-7OEM, and whatever else.
fi

Last edited by Earnestly (2012-03-19 12:26:20)

Offline

#4 2012-03-19 12:35:53

sms
Member
Registered: 2012-03-19
Posts: 4

Re: [SOLVED] Going back to X from console.

So, well, first of all:
thanks for the answer but now, trying to run the Windows session, I'm getting an error saying thet 3D acceleration of the host is not working properly...

VirtualBox is not really cool to use in the window... it needs to be fullscreen and switching betwen Gnome workspaces is blocked untill I will exit the fullscreen so it takes two key gestures to switch from Linux to Windows and it's maybe nothing but I figured why not to let it be elegant and easy? And about xMonad... it have no bars, nor borders after one-line-change and I believe in it's stability; why not to overkill this? It was already installed and in-use within Gnome anyway.

@Kaustic: I will now test your advices, brb. ;-)

Last edited by sms (2012-03-19 12:36:53)

Offline

#5 2012-03-19 12:41:02

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: [SOLVED] Going back to X from console.

sms wrote:

I will now test your advices

Keep in mind of what Trilby said earlier. If you have 6 ttys (default Arch) the first X session will spawn on tty7 and the second on tty8. (Ctrl+Alt+7/8)

Offline

#6 2012-03-19 13:10:56

sms
Member
Registered: 2012-03-19
Posts: 4

Re: [SOLVED] Going back to X from console.

Kaustic wrote:

edit: I agree with Trilby on this, however I made a few suggestions anyway.

I'm making the assumption you wish to automatically login on both tty1 (as gnome) and tty2 (as windows)?

If you don't want to autologin, then this first suggestion is not needed:

#/etc/inittab
[...]
c1:2345:respawn:/sbin/agetty -a sms -8 -s 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -a sms-windows -8 -s 38400 tty2 linux
[...]

Well, that's great but I believe it's not letting me edit /home/sms while logged it as sms... but I read somewhere at wiki.archlinux that it's something that can be done, I just forgot about it. Thanks!

Kaustic wrote:

Then edit your bash{_profile,rc} for sms-windows:

#/home/sms-windows/.bashrc

if [[ ! $DISPLAY && $(tty) = /dev/tty1 ]]; then
    xinit -nolisten tcp ~/.xinitrc #X Init script containing VBoxSDL --fullscreen --startvm Home-7OEM, and whatever else.
fi

But that's not working... after the changes, it's logging me as sms and sms-windows but runs only sms' X. I didn't really know bash and don't really know what are the changes about but when I applied them to sms' .bash_profile it's not running sms-windows' X either. When I replaced tty1 with tty2 and tty2 with tty1 (now I remembered that "!" is a negation, huh) it runs and exit X one time after another and I needed to wait for 5-minute-break to reedit the .bash_profiles.

Offline

#7 2012-03-19 13:34:27

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: [SOLVED] Going back to X from console.

if [[ ! $DISPLAY && $(tty) = /dev/tty2 ]]; then
    xinit -nolisten tcp ~/.xinitrc
elif [[ $DISPLAY = ":0" && $(tty) = /dev/tty2 ]]; then
    xinit -nolisten tcp ~/.xinitrc -- :1
fi

As I said, they're suggestions, play around and try things out for yourself.

PS: Again, untested.

Last edited by Earnestly (2012-03-19 13:41:48)

Offline

#8 2012-03-19 14:02:25

sms
Member
Registered: 2012-03-19
Posts: 4

Re: [SOLVED] Going back to X from console.

Kaustic wrote:
if [[ ! $DISPLAY && $(tty) = /dev/tty2 ]]; then
    xinit -nolisten tcp ~/.xinitrc
elif [[ $DISPLAY = ":0" && $(tty) = /dev/tty2 ]]; then
    xinit -nolisten tcp ~/.xinitrc -- :1
fi

As I said, they're suggestions, play around and try things out for yourself.

PS: Again, untested.

That, along with turning the 3D support for guest OS, helped. Thank you! :-)

Offline

#9 2012-03-19 14:14:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,652
Website

Re: [SOLVED] Going back to X from console.

sms wrote:

And about xMonad... it have no bars, nor borders after one-line-change and I believe in it's stability; why not to overkill this? It was already installed and in-use within Gnome anyway.

That makes sense then, I guess I was just confused by it having assumed you'd be using metacity (or whatever the normal gnome wm is).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB