3

I need to set-up the dev-environment to be able to debug the backend of an application in Eclipse.

There is a front-end (runnable under user1) and a back-end (runnable under user2). Each user has its own login with its own filesystem (under /home/user1 and /home/user2).

If debugging was not needed, I could just run the backend from the regular terminal session (where you can easily log in as user2) - and that works just fine. But that's not really a debugging (if you browse through log files).

To see the data (supplied by back-end) in the front-end, I obviously have to be logged in as user1. And that means I cannot access the full filesystem under /home/user2, which is what the backend needs.

I did come up with some "sort-of" an workaround, but I consider it extremely dirty - as a root I change the attributes of the whole directory /home/user2 to be readable by all. To say that I don't like it would be a major understatement. It might not be a big issue for dev machine, except you have to do it again and again for all new files that are created during runtime - which you have to do for each debug session (which is not very productive, but as a worst case - doable).

So, the question is - how can I get a terminal session with full GUI logged in as a different user than is already logged in on the same machine ? Sort-of like a XMing (but that is not a solution, since it requires another Windows machine) or RemoteDesktop (except I would be logging in to the same machine).

Simply put - two GUI desktop sessions for two different users (of same machine) running in parallel. From the googling I did, it seems like CentOS does not really support that - but I may be easily missing here something.

1 Answer 1

2

There are several different ways to accomplish this:

  1. Use Xephyr to launch a separate X session for user 2 and interact with it.

  2. Run a VNC X Server for user 2, and launch the programs to connect to it. You can then connect to it with a VNC viewer to interact with it.

  3. Run two X servers, each on a different virtual terminal. You can switch between them with Ctrl+Alt+F7 and Ctrl+Alt+F8 (usually)


That said, this isn't necessary. You can launch the back-end as user 2 such that it listens for debug connections on specific port, and the attach to it with Eclipse as user 1 in your main X session. This has the nice benefit of having both the front-end and back-end in the same Eclipse session for debugging.

5
  • Wow, this is pretty remarkable reply. I had no idea that there were so many ways. It is going to take me half of tomorrow to experiment with few of them. Sorry that I can't upvote you (it requires reputation of 15)
    – 3D Coder
    Jun 25, 2013 at 20:38
  • Glad I could help! If one of the solutions works for you, then you can click the checkmark outline next to the post to "Accept" the answer. This is just as rewarding as giving me an upvote (slightly better, actually) and will help future users know that you managed to find something that worked in this answer. Jun 25, 2013 at 20:43
  • 1
    @3DCoder Don't worry about it, I'll upvote you both, and nice answer darth, you actually took mine as a local school uses option 3 which was what I was going to put.
    – user88311
    Jun 25, 2013 at 22:27
  • Somehow my reputation rose by 15 points (perhaps the more points the upvoter has, the more points I receive ?) - so I could upvote finally. Right now I'm trying to figure out why the Xephyr hangs with black screen during initialization of SELinux. Quick question - is Xephyr supposed to work without restarting the machine ? I'm looking into configuring it here: en.wikibooks.org/wiki/Multiterminal_with_Xephyr
    – 3D Coder
    Jun 26, 2013 at 21:04
  • @3DCoder Your question has been upvoted 3 times, and you receive 5 reputation for each upvote. Jun 26, 2013 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .