Change-Defalt-Ubuntu-Login-From-GUI-To-Terminal


Edit /etc/default/grub and change ”quiet splash” to ”text”
# vi /etc/default/grub
...
#GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
GRUB_CMDLINE_LINUX_DEFAULT=”text”
...

#
then run
# update-grub

Reinstall LightDM

# apt-get purge lightdm
# apt-get install lightdm
# dpkg-reconfigure lightdm


# /usr/lib/lightdm/lightdm-set-defaults -u ubuntu  ------------  Set user-session
# /usr/lib/lightdm/lightdm-set-defaults -g unity-greeter -------  Set greeter-session
# /usr/lib/lightdm/lightdm-set-defaults -l false   ------------  Disable guest login

# cat /etc/lightdm/lightdm.conf
[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
allow-guest=false

#

Disable-UserList-on-UBuntu-12.04

LihgtDM
===============


Edit /etc/lightdm/lightdm.conf
Enter following line to [SeatDefaults] Selection:-
    greeter-hide-users=true

# vi /etc/lightdm/lightdm.conf
[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
greeter-hide-users=true
allow-guest=false

#

GDM
=============



$ sudo gconftool-2 /apps/gdm/simple-greeter/disable_user_list --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type=boolean true


Disable User List 10.04
---------------------------------------------


$ sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true

Swith-LightDM-to-GDM


# apt-get install gdm

# dpkg-reconfigure lightdm

# cat /etc/X11/default-display-manager

# /etc/init.d/lightdm stop
# /etc/init.d/lightdm start


toSwitchback
----------------------------


# dpkg-reconfigure lightdm
# cat /etc/X11/default-display-manager

# /etc/init.d/gdm stop
# /etc/init.d/lightdm start

Connect to WiFi on Ubuntu-Server


# ip a
# apt-get install network-manager wpasupplicant
# reboot

# nm-tool  ------> To get ESSID of   WiFi

# wpa_supplicant > /etc/wpa.conf

#

# cat /etc/wpa.conf
# wpa_supplicat -iwlan0 ic/etc/wpa.conf -B


For Permanent Settings
--------------------------------------


# vi /etc/network/interfaces
...
auto wlan0
iface wlan0 inet dhcp
wpa-conf  /etc/wpa.conf

#

Reinstall-or-Repair-GRUB


Using Ubuntu 9.10 livecd or higher
---------------------------------------------------------------

Here assuming the Ubuntu partition is sda7,and /boot partition is sda6 (if you have a separate /boot partition).
Boot up ubuntu from the livecd,open terminal and run:

# sudo -i
# mount /dev/sda7 /mnt
# mount /dev/sda6 /mnt/boot  #skip this one if not have a separate /boot partition
# grub-install --root-directory=/mnt/ /dev/sda


If you miss “grub.cfg” file,use following to recreate:

# mount --bind /proc /mnt/proc
# mount --bind /dev /mnt/dev
# mount --bind /sys /mnt/sys
# chroot /mnt update-grub
# umount /mnt/sys
# umount /mnt/dev
# umount /mnt/proc
# exit


Using the cd/usb boot up with grub
----------------------------------------------------------
Boot up the cd/usb,press c in grub menu.Type:

grub>find /boot/grub/core.img
grub>root (hdx,y)   (previous command will output the x,y)
grub>kernel /boot/grub/core.img
grub>boot


After the boot command,you’ll go into grub2 menu.Select to boot up ubuntu,and run this command to restore grub:

# grub-install /dev/sda

Install Boot-Repair in Ubuntu
------------------------------------------------------


- either from an Ubuntu live-session (boot your computer on a Ubuntu live-CD or live-USB then choose "Try Ubuntu") or from your installed Ubuntu session (if you can access it)

- connect to the Internet

- open a new Terminal, then type the following commands (press Enter after each line):

$ sudo add-apt-repository ppa:yannubuntu/boot-repair
$ sudo apt-get update
$ sudo apt-get install -y boot-repair
$ boot-repair


    Then click the "Recommended repair" button. 

Disable AutoDetection of HDD Partition on Ubuntu-Desktop

Add the entry of partition in '/etc/fstab' file with 'hidden' option

# egrep -v "^#|^$" /etc/fstab
....
/dev/sda7    /VM    ext4    defaults     0       0
UUID=96a1d938-558d-44 hidden   ext4   ro,noauto   0   0       #------>Partition to Hide
UUID=B40EA1870EA1436A hidden   ntfs   ro,noauto   0   0        #------>Partition to Hide
UUID=3AE87394E8734CDF hidden   ntfs   ro,noauto   0   0        #------>Partition to Hide

#


Run 'blkid' command to Get the UUID of PArtition

# blkid
/dev/sda1: UUID="B40EA1870EA1436A" TYPE="ntfs"
/dev/sda2: LABEL="Box" UUID="3AE87394E8734CDF" TYPE="ntfs"
/dev/sda4: UUID="12a0fdf8-36a2-4229-8eb1-61974bc96e9e" TYPE="ext4"
/dev/sda5: UUID="404dcc26-a3ef-456d-b582-0de7f31e68c9" TYPE="swap"
/dev/sda6: UUID="96a1d938-558d-448f-847b-6e407a7eed0a" TYPE="ext4"
/dev/sda8: UUID="8ec6b507-13f9-42c9-8bba-f57445efd0a5" TYPE="ext4
"
#


In Old Version of Ubuntu
-----------------------------

Add the '/etc/udev/rules.d/hide-partitions.rules ' file with 'ENV{UDISKS_PRESENTATION_HIDE}="1"' entry

# cat /etc/udev/rules.d/hide-partitions.rules
ACTION!="add|change", GOTO="hide_partition_end"
SUBSYSTEM!="block", GOTO="hide_partition_end"
KERNEL=="loop*|ram*", GOTO="hide_partition_end"
KERNEL=="sda6", ENV{UDISKS_PRESENTATION_HIDE}="1"
LABEL="hide_partition_end"

#

Ubuntu-14-PXE-Server-For-XenServer-Installation

# apt-get install apache2 isc-dhcp-server tftpd-hpa syslinux

# echo "ServerName UB14-PXE" >> /etc/apache2/apache2.conf


# vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 200.0.0.77
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 192.168.1.77
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8
auto eth2
iface eth2 inet static
address 150.0.0.15
netmask 255.255.255.0

#

# cat /etc/dhcp/dhcpd.conf
allow bootp;
use-host-decl-names true;
option domain-name "SVK-Net";
option domain-name-servers 192.168.1.1;
subnet 150.0.0.0 netmask 255.255.255.0 {
        range 150.0.0.100 150.0.0.150;
        filename "pxelinux.0";
}

#


Set Default interface to serve DHCP

# cat /etc/default/isc-dhcp-server
INTERFACES="eth2"
#



 Add the menu UI file handler.

# cp /usr/lib/syslinux/menu.c32 /var/lib/tftpboot/

# mkdir /var/lib/tftpboot/pxelinux.cfg

Edit /var/lib/tftpboot/pxelinux.cfg/default

# vi /var/lib/tftpboot/pxelinux.cfg/default

DEFAULT local
UI menu.c32
PROMPT 1
TIMEOUT 30

LABEL local
        localboot 0

LABEL Install-XenServer-6.2
        kernel xenserver6-2/mboot.c32
        append xenserver6-2/xen.gz dom0_max_vcpus=2 dom0_mem=752M com1=115200,8n1 console=com1,vga --- xenserver6-2/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=http://150.0.0.15/xenserver6-2/answerfile install --- xenserver6-2/install.img

LABEL Install-XenServer-6.5
        kernel xenserver6-5/mboot.c32
        append xenserver6-5/xen.gz dom0_max_vcpus=2 dom0_mem=752M com1=115200,8n1 console=com1,vga --- xenserver6-5/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=http://150.0.0.15/xenserver6-5/answerfile install --- xenserver6-5/install.img

#

For XenServer6-2
---------------------------------------

Insert XenServer6-2 CD and Mount

# mount /dev/cdrom /mnt
# cd /mnt

# cp ./boot/pxelinux/pxelinux.0 /var/lib/tftpboot ---->Only OneTime

# mkdir -p /var/lib/tftpboot/xenserver6-2
# cp ./boot/pxelinux/mboot.c32 /var/lib/tftpboot/xenserver6-2
# cp ./boot/vmlinuz /var/lib/tftpboot/xenserver6-2
# cp ./boot/xen.gz /var/lib/tftpboot/xenserver6-2
# cp ./install.img /var/lib/tftpboot/xenserver6-2


Create The Answer File and HTTP Repository

# mkdir /var/www/html/xenserver6-2
# cd /mnt
# cp -r packages*  /var/www/html/xenserver6-2
# cp XS-REPOSITORY-LIST /var/www/html/xenserver6-2

# vi /var/www/html/xenserver6-2/answerfile


sda
us
root123                     
http://150.0.0.15/xenserver6-2/
150.0.0.15       

Asia/Kolkata

#

# umount /mnt


For XenServer6-5
----------------------------

Insert XenServer6-5 CD and Mount

# mount /dev/cdrom /mnt
# cd /mnt
# mkdir -p /var/lib/tftpboot/xenserver6-5
# cp ./boot/pxelinux/mboot.c32 /var/lib/tftpboot/xenserver6-5
# cp ./boot/vmlinuz /var/lib/tftpboot/xenserver6-5
# cp ./boot/xen.gz /var/lib/tftpboot/xenserver6-5
# cp ./install.img /var/lib/tftpboot/xenserver6-5



Create The Answer File and HTTP Repository

# mkdir /var/www/html/xenserver6-5
# cd /mnt
# cp -r packages*  /var/www/html/xenserver6-5
# cp XS-REPOSITORY-LIST /var/www/html/xenserver6-5


# vi /var/www/html/xenserver6-5/answerfile


sda
us
root123                     
http://150.0.0.15/xenserver6-5/
150.0.0.15       

Asia/Kolkata

#

# umount /mnt

# /etc/init.d/networking restart
# /etc/init.d/isc-dhcp-server restart
# /etc/init.d/tftpd-hpa restart


Now reboot the Server Start installation using PXE



# ls -ltr /var/www/html/
total 20
-rw-r--r-- 1 root root 11510 Dec 17 11:55 index.html
drwxr-xr-x 5 root root  4096 Dec 17 13:21 xenserver6-2
drwxr-xr-x 5 root root  4096 Dec 17 13:22 xenserver6-5

#


# ls -ltr /var/www/html/xenserver6-2/
total 20
dr-xr-xr-x 2 root root 4096 Dec 17 12:14 packages.main
dr-xr-xr-x 2 root root 4096 Dec 17 12:14 packages.transfer-vm
dr-xr-xr-x 2 root root 4096 Dec 17 12:14 packages.xenserver
-r--r--r-- 1 root root   40 Dec 17 12:15 XS-REPOSITORY-LIST
-rw-r--r-- 1 root root  363 Dec 17 13:21 answerfile

#

# ls -ltr /var/lib/tftpboot/

total 96
-r--r--r-- 1 root root 27323 Dec 17 12:01 pxelinux.0
-rw-r--r-- 1 root root 55012 Dec 17 12:08 menu.c32
drwxr-xr-x 2 root root  4096 Dec 17 12:52 xenserver6-5
drwxr-xr-x 2 root root  4096 Dec 17 13:15 xenserver6-2
drwxr-xr-x 2 root root  4096 Dec 17 13:18 pxelinux.cfg

#

# ls -ltr /var/lib/tftpboot/xenserver6-2
total 32592
-r-xr-xr-x 1 root root    35548 Dec 17 12:01 mboot.c32
-r--r--r-- 1 root root   752011 Dec 17 12:02 xen.gz
-r--r--r-- 1 root root 30193487 Dec 17 12:02 install.img
-r--r--r-- 1 root root  2385786 Dec 17 12:23 vmlinuz

#

Convert-GPT-HDD-to-MBR


Boot from ubuntu 14.04 Live CD/Boot the emergency disk and open a text-mode shell.
Type gdisk /dev/sda (change /dev/sda to whatever is appropriate to access your hard disk, if necessary).
The program is likely to complain that it's found both MBR and GPT data, and will ask which to use. It doesn't matter which you tell it to use.
        At the Command prompt, type x to enter the experts' menu.
        At the Expert command prompt, type z to zap (destroy) the GPT data.
        Type y in response to the confirmation about destroying the GPT.
        Type n in response to the query about blanking the MBR. Caution: If you answer y here, you'll destroy Windows partition(s)!

# parted -l           --------- To Check the Partition table Structure

# apt-get install gdisk

# gdisk /dev/sda
...
Command (? for help):x
Expert Command (? for help):z
About to wipeout GPT on /dev/sda Proceed? (Y/N):y
    "GPT Data Structures Destroyed"
Blank out MBR (Y/N):n
    "MBR is unchanged"

#

# reboot