Showing posts with label Pentoo. Show all posts
Showing posts with label Pentoo. Show all posts

Tuesday, April 30, 2013

HOWTO : Troubleshooting CUDA on Pentoo 2013.0 RC1.1

As Pentoo 2013.0 RC1.1 is using hardened kernel, some application may not working properly. You may need to inspect and change the pax settings of the application in order to make it to work properly.

Use paxctl to inspect and change the pax settings.

paxctl -h
paxctl -v [application name]


Since the current Pentoo 2013.0 RC1.1 (as updated to April 29, 2013), the CUDA do not work properly by default. You are required to do something on it. This bug may be fixed in the next update or RC version.

First of all, make sure the libraries of CUDA are loading properly by making sure the following lines are at the file /etc/env.d/99cuda :

cat /etc/env.d/99cuda

PATH=/opt/cuda/bin:/opt/cuda/libnvvp
ROOTPATH=/opt/cuda/bin
LD_LIBRARY_PATH=/opt/cuda/lib64:/opt/cuda/lib


Finally, make sure some of the applications are set to proper pax settings. For example, cudaHashcat-plus64.bin and Cryptohaze-Multiforcer which are running with CUDA but they are not setting with pax flags properly at the current version.

Make sure the pax settings should be shown as the following :



Known Issue

The current version/update as on April 29, 2013, the pyrit does not work properly with CUDA. Since pyrit is written in Python, the paxctl does not work at all. According to one of the developers, the pyrit will be removed from the distribution.

That's all! See you.

Wednesday, April 10, 2013

HOWTO : VirtualBox 4.2.10 on Pentoo 2013.0 RC1.1

The current version (at the time of this writing) of VirtualBox is 4.2.10. However, it is masked in the main stream of Gentoo so as Pentoo. The reason of mask is unstable. It is recommended to use 4.1.24 from the Gentoo.

To install the current version of VirtualBox, you need to unmask it. I am a new comer of Gentoo/Pentoo, so my tutorial may not be 100% right.

Step 1 :

sudo eix virtualbox

sudo nano /etc/portage/package.accept_keywords

Append the following lines :

=app-emulation/virtualbox-bin-4.2.10 ~amd64
=app-emulation/virtualbox-modules-4.2.10 ~amd64
=app-emulation/virtualbox-guest-additions-4.2.10 ~amd64
=app-emulation/virtualbox-extpack-oracle-4.2.10 ~amd64
=app-emulation/virtualbox-additions-4.2.10 ~amd64
=app-emulation/virtualbox-4.2.10 ~amd64


sudo eix-update
sudo eix virtualbox


You will then see the current version on the screen.

sudo nano /etc/portage/make.conf

Append "PUEL" at the end of the ACCEPT_LICENSE :

ACCEPT_LICENSE="AdobeFlash-11.x Intel-SDP PUEL"

Step 2 (Install from the binary) :

** This step is tested **

Then check if the installation of VirtualBox will be working or not. I am going to install the "virtualbox-bin", the binary file, instead of compiling from source :

sudo emerge -pa virtualbox-bin

If everything is alright, you can install it :

sudo emerge -av virtualbox-bin

Step 3 :

After the installation, you need to add yourself (samiux here) to the group of "vboxusers" on the host (Pentoo) :

sudo gpasswd -a samiux vboxusers
sudo gpasswd -a vboxusers samiux


Step 4 :

Since the necessary modules of VirtualBox do not load properly, you need the following script to load and unload it when necessary.



Download it and save it at /etc/init.d/virtualbox :

sudo chmod +x /etc/init.d/virtualbox

To start it :

sudo /etc/init.d/virtualbox start

To stop it :
sudo /etc/init.d/virtualbox stop

To start it automatically when boot :

sudo rc-update add virtualbox default

Update :

According to one of the developers, you have another way to load the modules automatically :

echo modules="vboxdrv vboxnetflt vboxnetadp" >> /etc/conf.d/modules

Step 5 (General Linux) :

Install Linux guest (when necessary). After the installation, you need to add yourself (samiux here) to the group of "vboxsf" on the guest (Linux) :

sudo gpasswd -a samiux vboxsf

*** make sure it is vboxsf BUT NOT vboxfs.

Then, the share folder feature will be working properly.

Step 6 (Pentoo) :

Install the same version of virtualbox-guest-additions in your guest (Pentoo / Gentoo) as above mentioned method.

At the guest (Pentoo), you should do the following as the required module does not load properly and the mount does not work automatically.

sudo nano /etc/local.d/00-vboxsf.start

modprobe vboxsf
mount -t vboxsf vbox_share /media/sf_vbox_share


sudo chmod +x /etc/local.d/00-vboxsf.start

sudo gpasswd -a samiux vboxsf

Reboot your guest.

That's all! See you.

Friday, April 05, 2013

HOWTO : Customize Pentoo 2013.0 RC1.1

Once you installed and updated Pentoo 2013.0 RC1.1, you may consider to install some packages on it. I selected some of them for the installation.

sudo emerge -av galculator
sudo emerge -av shutter
sudo emerge -av radiotray
sudo emerge -av preload
sudo emerge -av xfce4-weather-plugin
sudo emerge -av gtk-recordmydesktop
sudo emerge -av gnome-system-monitor
sudo emerge -av xfce4-kbdleds-plugin
sudo emerge -av xfce4-cpufreq-plugin
sudo emerge -av gnome-media


If you need LibreOffice, you need to install it but it will take a very long time to compile from source code :

sudo emerge -av libreoffice

*** If you have a very slow CPU or do not want to compile LibreOffice from source, you can install the binary package instead if it is available :

sudo emerge -av libreoffice-bin

Installation of Network Manager

If you do not like the Wicd and will use VPN or mobile network (such as 3G) :

sudo emerge -av networkmanager
sudo emerge -av networkmanager-pptp
sudo emerge -av networkmanager-openvpn
sudo emerge -av networkmanager-vpnc
sudo emerge -av nm-applet


Then make it boot by default :

rc-update add NetworkManager default

Now, set to load GNOME service on boot :

Menu -- Settings -- Session and Startup -- Advanced

Select "Launch GNOME services on startup"

*** Make sure you unselect the Wicd at "Application Autostart".

Then, reboot your box.

Installation of GPointing Device Settings

sudo emerge -av gpointing-device-settings

Menu -- Settings -- Session and Startup -- Application Autostart

Select "GNOME Settings Daemon"

If you have ThinkPad with TrackPoint, you may need to set the Firefox to use the middle button :

Firefox -- Edit -- Preferences -- Advanced -- General

Select "Use autoscrolling"

Then, all the hotkeys of ThinkPad should work.

Installation of 3G USB Modem

sudo emerge -av usb_modeswitch
sudo emerge -av modemmanager


Add user to the group of plugdev :

sudo gpasswd -a samiux plugdev

Then, reboot your box.

Bonus #1

To make your Pentoo more secure by append the following to /etc/fstab :

tmpfs /tmp tmpfs noexec,nosuid,nodev,mode=1777,size=512M 0 0

*** Make sure the size is large enough for Pentoo to compile packages when update/upgrade. Or, simply DO NOT set this settings.

Bonus #2

If you are using hard drive and want to make Pentoo more faster, you can edit the /etc/fstab as the following :

/dev/sda1 /boot ext2 noatime,nodiratime,defaults 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext4 noatime,nodiratime,defaults 0 1


If you are using SSD, you can :

/dev/sda1 /boot ext2 noatime,nodiratime,defaults 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext4 discard,noatime,nodiratime,defaults 0 1


It will look like the following :



That's all! See you.



Sunday, March 31, 2013

HOWTO : Update Pentoo 2013.0 RC1.1 on ASUS Sabertooth X79

For routine update/upgrade of Pentoo, you need to follow the following steps :

# This syncs the gentoo and pentoo repos like "apt-get update" in debian
emerge --sync
# This updates all the normal packages like "apt-get upgrade" in debian
emerge --deep --update --newuse world -vt
# This optionally merges in changed config files. unchanged files are merged automatically
etc-update
# This removes old packages which are not needed like "apt-get autoremove" in debian
emerge --depclean
# This rebuilds anything which may have been broken in update
emerge @preserved-rebuild
# This checks all the programs installed from VCS for new revisions and updates if needed
smart-live-rebuild
# Verifies there is no breakage after updates
revdep-rebuild
# Regenerate the main menu for XFCE WM (run it under each regular account)
genmenu.py -x
#merge in any new config files
etc-update
#clean up the distfiles dir to remove old/un-needed files
eclean-dist -d

Optional
# Check /var/log/portage/elog/summary.log file
# You might need to run extra commands. For example:
emerge @x11-module-rebuild
eselect java-vm set system icedtea-bin-7

#after python/perl upgrade:
perl-cleaner --modules
python-updater


That's all! See you.

Install Pentoo 2013.0 RC1.1
Customize Pentoo 2013.0 RC1.1

Saturday, March 30, 2013

HOWTO : Pentoo 2013.0 RC1.1 on ASUS Sabertooth X79

After about a month of tries and errors, this article is the most updated and error free for the Pentoo 2013 RC1.1 installation as at April 22, 2013.

Pentoo is based on Gentoo and it is a Penetration Testing Linux distribution. The developers of Pentoo targetted their product for serious Pentesters. Pentoo is not for newbies as it is based on Gentoo which requires some Linux experience to master this distribution.

Hardware

CPU : Intel i7-3930K (6 cores, 12 cores with Hyper-Threading, Socket 2011)
Motherboard : ASUS SaberTooth X79
RAM : Corsair Vengeance DDR3 1600 32GB (4GB x 8)
Hard Drive : WD SATA III 3TB Red WD30EFRX
Display Card : Inno3D nVidia GeForce GTX 590 384bit 3072MB DDR5 x 2

Making of Bootable USB Pendrive

Use UNetbootin to make a bootable USB pendrive. Before booting, edit syslinux.cfg on the usb pendrive and add "nodetect" to the kernel line to prevent asking for password when boot. Unetbootin switches the bootloader and there was a mistake in the converted config file. This issue has been logged and fixed for the next release.

Live USB Boot to Desktop

Press F8 to pop up the BIOS boot menu and DO NOT select the UEFI option of the USB pendrive.

Once it is booted up, at the "livecd" prompt type the following to bring up the ethernet card. Make sure you are connecting to the internet :

dhcpcd eth0

Type the following to build the latest version of nVidia display card driver :

mkxf86config.sh
eselect opengl set xorg-x11
nvidia-xconfig


After that, type the following command to bring up the desktop :

startx

Live USB Boot to Install

Step 0 :

Press F8 to pop up the BIOS boot menu and DO NOT select the UEFI option of the USB pendrive.

Step 1 :

dhcpcd eth0
layman -s pentoo
emerge -1 pentoo-installer


pentoo-installer

Step 1a :

If you have a hard drive that is larger than 2TB, you need to manual configure your partitions :

/dev/sda1 - /boot
/dev/sda2 - swap
/dev/sda3 - /


Then following the menu to install step by step. At last, you will be asked for install the bootloader, you should install to /dev/sda.

Step 2 :

After the installation, remove the USB pendrive and reboot your box and login as root.

Next, clean up live configuration :

dhcpcd eth0

Fix the /etc/inittab file :
rc-update delete fixinittab
emerge -1 sys-apps/sysvinit


Remove live-related configuration :
rm /etc/gconf /usr/share/livecd
emerge -1 gnome-base/gconf


Then, reboot your box again and login as root.

Step 3 :

(First time configuration)

You are advised to follow the prompt from the screen to do the update.

dhcpcd eth0
nano /etc/portage/make.conf


ACCEPT_LICENSE="AdobeFlash-11.x Intel-SDP PUEL"

# You may wish to edit your VIDEO_CARDS line to match your system better.
# nVidia users:
USE="binary-drivers cuda opencl qemu -doc -examples"
VIDEO_CARDS="nvidia fbdev vga vesa"


# AMD (ATi) users :
USE="binary-drivers opencl qemu -doc -examples"
VIDEO_CARDS="fglrx fbdev vga vesa"


If you are installing Pentoo to virtualbox or vmware, please use the following settings :
# Guest OS users should add virtualbox/vmware flags:
USE="binary-drivers opencl qemu -doc -examples"
VIDEO_CARDS="virtualbox fbdev vga vesa"


Step 4 :

(First time update)

emerge --sync

After that, you are required to react to the recommendation on the screen (which is usually in green colour). You may requried to update portage (if any), please do :

emerge --oneshot portage

Then, you may prompt to do the following (if any) :
emerge @preserved-rebuild

*** nVidia and cuda drivers are to be installed then. If AMD (ATi), no action to be taken.

Reboot the box and login as root again.

Step 5 :

If nVidia user :
nvidia-xconfig

startx

To update/upgrade the packages :
emerge --deep --update --newuse world -vt

To merge the config files (if any) :
etc-update

*** select "-3" to replace with the new config files and answer "yes" for all questions.

To delete not necessary packages including unused video drivers :
emerge --depclean

To rebuild anything when some packages are broken in the update :
emerge @preserved-rebuild

To update/upgrade the SVN packages :
smart-live-rebuild

To make sure there is no breakage after the update :
revdep-rebuild

To regenerate the main menu of Xfce window manager (you are required to do this step on each user) :
genmenu.py -x

To check if any config file need to be merge or not :
etc-update

To clean up the box (remove old or not needed packages) :
eclean-dist -d

To rebuild X11 related drivers :
emerge @x11-module-rebuild

To set the java vm to the latest version :
eselect java-vm list
eselect java-vm set system icedtea-bin-7


or

eselect java-vm set system 1

*** if the icedtea-bin-7 is in the first item.

To recompile perl when it is upgraded :
perl-cleaner --modules

To recompile python when it is upgraded :
python-updater

Step 6 :

After that, reboot and login as root.

If you would like the xfce4 window manager :
startxfce4

Else, if you want to have e17 window manager :
startx

The network interface name will be changed to "eno1" (due to udev-2000) for my box (you may need to use "ifconfig -a" to confirm :

dhcpcd eno1

startxfce4

To make sure wicd will be launch without problem even you are login as normal user :
rc-update add wicd default

Step 7 :

nano /etc/conf.d/hostname

Change to :
HOSTNAME="pentoo"

*** or any hostname you like.

Step 8 (Optional) :

If you are AMD (ATi) user, you may need to do the following in order to launch the window manager :
rc-update add acpid boot

*** If you login as normal user, you just "startx" to xfce4 window manager.

*** If you login as root but want to use "startx" to xfce4 window manager, you need to :

nano .xinitrc
exec ck-launch-session startxfce4
#exec enlightenment_start


Step 9 (Optional) :

If you do not want to have weird or new network interface name, you can refer to this link to fallback to kernel based name.

Or simply following the below step :

ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

Then, reboot your box.

Know issue

As at April 22, 2013, CUDA and her related applications, such as pyrit, cudaHashcat-plus64.bin and Cryptohaze-Multiforcer do not work due to the Pentoo's hardened kernel. The workaround for Cryptohaze-Multiforcer is at here. Hope the development team can solve this problem as soon as possible.



That's all! See you.

Update Pentoo 2013.0 RC1.1
Customize Pentoo 2013.0 RC1.1