How do I su(1) to another user and run an X application?
You need to set your $DISPLAY and allow others to use your console. If you don’t, you get a message like “Can’t open display”. By default, only the user who logged in on console can connect to the display. To allow another user to connect there are two ways – one easy and one secure (unfortunately, you can’t have both): Easy: As user logged in on console run “xhost +LOCAL:” (This gives permission to connect to the display to anyone logged in on the machine—this includes being able to open windows, read your keystrokes, send keystrokes, etc. Obviously not a good idea if you have other users on the system you don’t trust completely.) Starting with Solaris 10, you can also use this safer, more-restrictive format: xhost xhost +si:localuser:username For example: xhost +si:localuser:root As any other user logged in on the box, run “setenv DISPLAY :0” or “DISPLAY=:0; export DISPLAY”, depending on your shell type.
Related Questions
- Can I deliver the directory created by generate-application? That is, can a user of my application simply install the directory and run the .exe file?
- The IMEI field stays blank even after the application has been assigned and the user has run Download Apps. What should I do?
- Under which user identity does the cDir application run on the server?