Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm using Ubuntu 18.04 as Windows Subsystem for Linux on my Windows 10 machine.
I've installed gedit without any errors or warnings.
But whenever I try to use the command gedit something (here something is a filename)
I get this error:
Unable to init server: Could not connect: Connection refused
(gedit:48): Gtk-WARNING **: 21:03:26.729: cannot open display:
You need an X server to run graphical applications like gedit.
I use VcXsrv or Xming on my Windows desktops, both are very small and easy to install,
but there exist other servers like Cygwin/X.
Short instructions for VcXsrv/Xming:
download and install the Windows package
start XLaunch or Xming
export the DISPLAY variable in your WSL terminal and start gedit
export DISPLAY=0:0
gedit
I have the problem that some checkboxes in gedit's preferences are not working (dconf error, I don't care), but other than that the editor is usable.
Related:
What's the easiest way to run GUI apps on Windows Subsystem for Linux as of 2018? (askubuntu.com)
To fix this problem
Step 1- Download and Install this Windows X Server https://sourceforge.net/projects/vcxsrv/
Step 2- Open XLaunch
Step 3- Select " Full screen " option
Step 4- Choose " Start no client " option
Step 5- Simply do next and finish
Step 6- Open terminal and type :
export DISPLAY=0:0
gedit filename
In case your Linux machine is available with host name = 'hostname' and you'd want to ssh into the hostname and then open gedit then execute the following commands:
Enable X11Forwarding in the ssh server
[hostname] $ vim /etc/ssh/sshd_config
# and set X11Forwarding to yes
X11Forwarding yes
Set the DISPLAY env in the client terminal and then ssl with -X flag
export DISPLAY=0:0
ssh -X yourusername#hostname
[hostname] $ gedit filename
It's probably because you are running it with root user.
Run it as non-root user.
(If you don't know that if you are running it as root or not, enter the command below and if it returns 0, it means you are root and you must to login to non-root user: id -u)
(If you had run sudo su or something like that, It means you are root and you must use exit to go back!)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I am trying to use VirtualBox to set up a multi-host software testing environment. I need to share code and data between the VM and host computer (Ubuntu Linux in both cases). Using the "Shared Folders" menu item from VirtualBox does not seem to enable folder sharing as desired.
How do I properly configure shared folders between the host and the VM?
Open your VM And go to the top menu Device and click on Insert Guest Additions CD
Now go to the VM setting and follow the settings
Folder path, you locate your share folder. After that give a Folder name
Now again go to in your VM terminal
and type the following command
$ sudo /media//VBox_GAs6.0.12/VBoxLinuxAdditions.run
$ mkdir /home//shared
$ sudo mount -t vboxsf ubuntushare /home//shared
If you have not already done so, make sure the VirtualBox Guest Additions are already installed (top
menu -> Devices -> Insert Guest Additions CD, then follow the prompts)
On the host, go to VirtualBox window:
top menu -> Devices -> Shared Folders -> Shared Folder Settings
Click "+" icon on right:
Under "Folder Path" navigate to an absolute pathname on the host like "/home/joe/myFolder"
Under "Folder Name" enter a unique ID like "someName"
On guest VM, open a terminal and type:
> sudo mkdir -p /mystuff
> sudo mount -t vboxsf someName /mystuff
The trick is that the ID string "someName" is just a tag to connect the host directory and the VM
directory. It has not other purpose. The shared folder /home/joe/myFolder is now available as the dir /mystuff in the VM. Note
that the directory name in the VM doesn't have to match the original directory name on the host, although we could make them similar if we wanted (e.g. /myfolder or /joe/myFolder in the VM).
The VirtualBox GUI does not make a clear distinction between the directory name on the host, the directory
name on the VM, and the ID string that connects them.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'm a user of Ubuntu 12.04 LTS and in a future a user of Ubuntu 14.04 LTS.
I have a problem, when I run Ubuntu my .bashrc script doesn't work unless I open the terminal.
This is a problem because, for example, the paths I write doesn't work unless I execute the programs from the terminal.
Are there an user config startup file for Ubuntu and not for the terminal?
P.D.:Maybe I don't explain very well, in other words, I'd like to execute mi scripts on Ubuntu startup without using the terminal.
Shell initialisation files (.profile, .bashrc, etc.) are intended for preparing the user's (interactive) environment.
For standalone scripts, it's better to make them independent from the environment, including
$HOME, $PATH, etc.
If you need to share code (functions, configuration) with other scripts, store that in a separate
shell library that you source from a known location, either through a fixed path or from a
path relative to the script's own location.
you can add the line below at the start of your script file
source ~/.bashrc
grep '/etc/bashrc' ~/.bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc # --> Read /etc/bashrc, if present.
by default /etc/bashrc gets loaded when opening a console.
What are you trying to do - if you want to do something without it being executed as part of a console and more to do with system startup ? then you need to look into modifying existing service or adding a new service.
If this is related to when users ssh or connect it via console then its be bashrc file
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have performed the following steps to install OpenLdap on my Redhat Linux Server:
1. untar the tar file
2. ./configure <--this ran successfully without error
3. make depend
4. make
5. make test <-- couldn't find any error
6. make install
7. started slapd: /usr/local/sbin/slapd
But the service is not starting. I don't see any slapd process in the ps -lef | grep slapd output. Also I see this, when i run : ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
What could be the error and also How can I completely uninstall OPENLDAP
There are two questions here:
What could be the error?
It's possible that you haven't appropriately configured slapd. There are probably errors in your syslog (/var/log/messages) that will help you diagnose problems. You can also run slapd in debugging mode (slapd -d none) to see errors displayed on your terminal.
How can I completely uninstall OpenLDAP?
That's a little tricky, since you (a) elected to install it from source rather than using an existing package and (b) you didn't install it into a dedicated directory. To completely uninstall it, you would have to pay close attention to what files are installed by running make install and then remove them.
However, there's no harm in leaving the files installed on your system as long as you're not using them. You can remove anything that was installed into /usr/local/bin or /usr/local/sbin if you want to prevent them from conflicting with versions of those commands installed via system packages.
If OpenLDAP is the only thing you've installed in /usr/local you can just remove any files below that directory.
Generally, if you can use the pre-packaged versions of software available in your Linux distribution your life will be easier. For example, if you were to install the RedHat openldap-servers package, you would have a default configuration that would allow slapd to start and run correctly.
To uninstall. look through either the log output from the configure command, or type "configure --help" to see a list of directories that things are installed in by default. Most likely it populated files into /usr/local/bin, /usr/local/lib, and so forth, so you'll need to into those directories and remove the files by hand.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm new to linux. I have Ubuntu and I would like to run a .run installer in my Downloads folder. The name of the run file is "xampp.run"
I've read that you first have to run
chmod +x xampp.run
to change mode to installer and then run
./xampp.run
to run the installer. However, nothing happens when I try these. I'm running from root#ubuntu.
This is what I've done in my shell.
Download and install XAMPP for x86_64 Linux.
.run files are executables, not unlike windows-installers(M$)
You may need root permission to execute the file.
su to root, and enter the root password, or use sudo before your command
then either cd to the directory where the .run file is
or use "absolute addressing" and
type in a terminal shell...
sh (filename).run
Generally you can evoke a help screen (not always) by adding --help on the end.
sh (filename).run --help
(this may give you options to apply to the install script.)
Hope this helps
You should download 64bit version of Xampp.
this steps is for ubuntu user
sudo chmod 755 xampp-linux-1.8.2.0-installer.run
sudo ./xampp-linux-1.8.2.0-installer.run
(This will extract all the packages to the /opt/lampp directory)
Then start the service
/opt/lampp/lampp start
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using Linux Suse 10 and I am a complete noob when it comes to using it that's why I really needed some help.
The scenario is simple. I need to transfer some files from my linux server to a windows pc.
I already did this using FTP commands written inside a .scr file. Here's the content of my Upload.scr :
ftp -n 10.*.*.* <<SCRIPT
user administrator drowssap
cd TESTDIR
binary
lcd /path/of/the/txt/file/
put TESTUpload.txt
bye
SCRIPT
And then I would call it from linux Konsole using :
bash Upload.scr
It was actually working and could successfully transfer files to my windows pc. However, what I need is to transfer the files using "psftp".
The original code which works from windows-to-windows transfer is :
ProcessStartInfo PSI = new ProcessStartInfo("CMD.exe", "/C psftp " + UserName + "#" + IP + " -pw " + Password + " -b UpLoad.scr");
I needed to do the same to my linux-to-windows transfer (i.e. I needed to use psftp instead of just ftp or sftp).
Whenever I tried to type "psftp" on linux Konsole it would display the ff :
bash: psftp: command not found
I know there's something missing. What should I do first to make it work? Should I install some application or .exe file into my linux server?
I really need help.
Thank you very much in advance! :)
psftp is PuTTY's SFTP utility.
OpenSSH has one too, named simply sftp (without the p). It is very likely already installed on your Linux machine.
If you want to install PuTTY's psftp, you just need to run:
apt-get install putty-tools
or equivalent for your distribution.