Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, May 20, 2016

Terminal is Not Opening In Linux

When try to open terminal in linux (debian, ubuntu,..) that defaults uses GNOME-Terminal it refuses to start.
And when try to open from cli "root@sys:~# gnome-terminal" from any terminal (install 'Xfce Terminal' or 'LXTerminal' to run following commands)it shows the following error.

Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: Timeout was reached

This error show that there is some problem to start GNOME Terminal service.
To check the failed services in system by user run the sollowing command systemctl which used for control systemd and processes.

root@sys:~# systemctl --user --failed
  UNIT                          LOAD   ACTIVE SUB    DESCRIPTION
* gnome-terminal-server.service loaded failed failed GNOME Terminal

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

Here its  shows the gnome-terminal-server.service unit or service is loaded but not active.
There can be several reason to cause these error like misconfig of terminal profile, system locale is not set.

To solve this first you need to install gnome-terminal by typing :

root@sys:~# apt-get install gnome-terminal

If u have already installed it then 'purge' it so if there is any misconfig of profile or configuration file then it will remove it.
This Package will also remove when you purge the GNOME terminal so install it again.

root@sys:~# apt-get install gnome-terminal
root@sys:~# apt-get install gnome-core*
root@sys:~# apt-get install gnome-terminal*

Reboot the computer and try to open terminal if still getting error then check system locale.

root@sys:~# localectl

LANG="your locale,shoud not be empty"
To generate locale run following command.

root@sys:~# locale-gen

To set your locale run following command(in my case : en_US.UTF-8).

root@sys:~# localectl set-locale LANG="en_US.UTF-8"

After setting system locale reboot the computer and open gnome-terminal it will open successfully.

Friday, April 1, 2016

Root Access Problem For VLC in Linux

Sometimes its shows the privileges error when trying to open VLC in linux or from terminal even running as root.

error: Cannot determine unprivileged user for VLC!

To solve this error we need to change vlc binary file located at(/usr/bin/vlc by default). Or if u have Hex Editor then open vlc binary file and search for word 'geteuid' and replace it with 'getppid'.
If don't have hex editor then just simply execute this command.

'sed -i 's/geteuid/getppid/g' /usr/bin/vlc'

It which will fix this error .That's it..

Tuesday, March 29, 2016

How to Mount Hibernated Windows Partitions in Linux

ERROR:
Error mounting: mount exited with exit code 14: Windows is hibernated, refused to mount.
Failed to mount '/dev/sda5': Operation not permitted
The NTFS partition is hibernated. Please resume and shutdown Windows
properly, or mount the volume read-only with the 'ro' mount option, or
mount the volume read-write with the 'remove_hiberfile' mount option......

Why ?
You are seeing this error because you hibernated Windows instead of turning it off the normal way (in newer versions of Windows, hibernate might be the default option).

Hibernating saves the current state information to the hard disk and then powers down the computer. When you turn off Windows by hibernating it, you are essentially pausing the system and saving all of that information into a big file called hiberfil.sys This way when you resume from hibernation all of your applications and files will be exactly how you left them. It also sets a flag in hiberfil.sys to let other Operating Systems know that Windows is hibernated.

Shutting down the computer closes all programs and ends all running processes before powering down the computer

Making changes to your Windows  partition while it is hibernated could be dangerous, ,t could cause Windows to not resume from hibernation or to crash after resuming.

In Linux to mount hibernated windows do as following:

Make Folder of any name in Media Directory(/media)
e.g. Make folder manually or

sudo mkdir /media/WINTMP

After then Run this command (with superuser permission if needed) in terminal with created folder name where to mount windows partition. Here sda2 is a partition of windows file System so First Check that where your windows partition is stored.
e.g.

sudo mount -t ntfs-3g -o remove_hiberfile /dev/sda2 /media/WINTMP

-------------------------------------------------------------------------------------------------------
Solution for Windows 8 and 10:
There is a new feature in Windows 8 called Fast Startup.This feature is enabled by default, Windows 8 does not actually completely shutdown when you choose shutdown. Instead, it does a "hybrid shutdown". This is something like hibernating; it makes booting Windows 8 back up faster. So, you need to disable this feature to be able to shut it down properly, and be able to mount the Windows partitions. Fast Startup can be Disable from power option in Control Panel.By disabling Fast Startup windows 8 will take a longer time to boot.

If you still aren't able to mount without getting errors, you should turn off hibernation completely. Open Command Prompt as Administrator and Run following Command :

powercfg /h off