How to install ArchLinux on VMWARE Workstation

How to install ArchLinux on VMWARE Workstation.

Requirements: – Installation media (Following ISO image was used for this installation:archlinux-2014.06.01-dual.iso) – Internet access – VMWARE workstation

1. Create custom Virtual Machine

For 64 bit OS: Choose “Other Linux 2.6.X kernel 64 bit”

Remark: If you choose wrong Guest OS, some commands especially “pacstrap /mnt base” will fail.

2. Boot the installation ISO image and choose appropriate option from boot menu:

For 64 bit OS: Choose “… x86_64”

3. Partition hard drives

Use “cfdisk” command to create partitions. If you have 1 disk only, you need 2 partitions:

a) Boot  (/dev/sda1)

b) Swap (/dev/sda2)

4. Format hard drives

Format Swap partition:

mkswap /dev/sda2

swapon /dev/sda2

swapon –s (allows to display the swap partition details)

Format other partitions:

mkfs.ext4  /dev/sda1

5. Mount partitions  

Mount partition:

mount  /dev/sda1  /mnt

 

6. Install base system

pacstrap /mnt base

7. Install Boot loader

pacstrap /mnt grub-bios

8. Configure the system

genfstab –p /mnt >> /mnt/etc/fstab

arch-chroot /mnt

mkinitcpio –p linux

grub-mkconfig –o /boot/grub/grub.cfg

grub-install /dev/sda

passwd

exit

9. Perform post-install tasks

umount /dev/sda1

Reboot the machine:

systemctl reboot

 

Posted in Uncategorized | Leave a comment

Create a fully controlled NAS using Ubuntu 12.04 LTS server

Create a fully controlled NAS using Ubuntu 12.04 LTS server

Description:

  1. Hardware
  2. Install Ubuntu server
  3. Install webmin
  4. Change network setting
  5. Create Logical Volume Management module in Webmin
  6. Install Samba
  7. Install LAMP
  8. Install ownCloud
  9. Install BT download

 1. Hardware: (one of my old machines)
CPU:  core 2 duo E6300 (you can use Celeron or Pentium CPU)
MOTHERBOARD: Asus G41 with Realtek gigabit lan on board
RAM: 4GB (you can use 2GB)
DISPLAY: on board display

2. Install 64 bit ubuntu server
Download the 64 bit server iso ubuntu-12.04.3-server-amd64.iso from http://www.ubuntu.com/download/server. Burn the iso into a DVD and install the server using it.

Note:

  • Hostname: e.g. nas
  • Partitioning Disks: Select the “Guided – Use Entire Disk and set up LVM” option. For HD 1TB or more, use 50G for the OS. This will leave plenty of room for Data. With LVM, it is easy grow the partition later.
  • You’ll need to choose a Username. e.g. test. For password, keep it short, as you’ll be typing it everytime you login to the server.
  • Do not encrypting your home directory.
  • Choose install security updates automatically.
  • Under “Software Selection” select OpenSSH server only. We’ll install the other things later.

After installation, use the user account e.g. test to login locally and change the root password using

sudo passwd
and note the ip address of the host by
ifconfig
you can change network setting using webmin later.

Update the installation using the following 2 commands
apt-get update
apt-get upgrade

3. Installing webmin

login using ssh client e.g. putty with root account
wget http://sourceforge.net/projects/webadmin/files/webmin/1.660/webmin_1.660_all.deb

Install dependencies
apt-get install libnet-ssleay-perl libapt-pkg-perl libauthen-pam-perl libio-pty-perl libapt-pkg-perl apt-show-versions
then install webmin
dpkg -i webmin_1.660_all.deb
You can now log in to webmin using root account https://ip address:10000

4. Change network setting(option)
Select Networking → Network Configuration, then

Network Interfaces → set fix IP e.g. 192.168.0.250
Routing and Gateways → set default Gateway e.g. 192.168.0.1
Hostname and DNS client→ set DNS server e.g. 192.168.0.1

5. Create Logical Volume Management module in Webmin
First create a directory for mounting the new volume in ssh
mkdir /media/nas

Then login into webmin using root account, select
Hardware → Logical Volume Management

  • Volume Name: choose a name and type it in “Volume Name” e.g. “share.”
  • use Non-Contiguous:
  • Size: When  setting the size, don’t use the whole drive. Use about ~500G for 1TB HD.  You can grow it later.

Select “New Linux Native (ext4)” and click the “Create Filesystem of Type:” button

Fill in the mount directory i.e. /media/nas and press mount button

6. Install Samba

In console, type
apt-get update && apt-get install dbus samba

create user with normal login
useradd -g users -G audio,floppy,lp,games -s /bin/bash [nameofnewuser]
give the user a passwd
passwd [nameofnewuser]

In webmin
click on the “convert UNIX Users to Samba Users” Button.
Click on Edit Samba users and passwords. Here you must click on the name of each user you wish to give samba access, select “New Password” and type their password in the field.
Create a new file share underneath the list of your serves on the Samba Page in Webmin

From Here you can enter your settings:

  • Share Name: e.g.”share”
  • Directory to Share: if you click the “…” button you can browse to the      folder you would like to make available.
  • Create with owner: Change this to your username.
  • Create with group: change this to “users”.
  • Share Comment: this is the description that will appear on the      file share.

Once you’re done you can hit “Create.” when you get back to the samba screen, click on the name of the Share you just created so we can change a couple settings.

In Security and Access Control change Writeable to “yes.”

In File Permissions, Change New Unix File Mode to 775 and New Unix Folder Mode to 775. This will make it so that any files or folders created through samba are editable by anyone in the group of the file’s creator, which should be users. When you’re finished, go ahead and return to the main Samba Page and click on Restart Samba Servers to apply the changes. (Note: sometimes webmin does not work. Then using ssh to change them)

From your pc “Network” in your “My Computer”, you should be able to see your Samba Shares and have RW right.

7. Install LAMP is simple for Ubuntu.

For root ssh, just type
tasksel install lamp-server
you will be prompt for mysql root password twice. Choose any password you like.

8. Installing ownCloud

First install prerequisites for ownCloud.
Use root SSH, type

apt-get install php5-gd php-xml-parser php5-intl smbclient curl libcurl3 php5-curl
We need to enable mod_rewrite and mod_headers, the Apache2 modules that are needed for ownCloud to function normally.
a2enmod rewrite
a2enmod headers

Change Apache2 config file in order for ownCloud rewrite rules to work properly
nano /etc/apache2/sites-available/default

find “<Directory /var/www/>” section and change the following:

AllowOverride None to AllowOverride All
Save the file and restart apache.
service apache2 restart

Downloading ownCloud 5 and Install it

wget http://download.owncloud.org/community/owncloud-latest.tar.bz2
tar -xjf owncloud-latest.tar.bz2
mv owncloud /var/www

Change folder permission
cd /var/www
chown -R www-data:www-data owncloud

Create a new MySQL Database for owncloud
Login mysql using mysql root
mysql -u root –p
type the mysql root password then type

CREATE DATABASE owncloud;

Grant rights to users
GRANT ALL ON owncloud.* TO ‘owncloud’@’localhost’ IDENTIFIED BY ‘somepassword’;
For ‘somepassword’ choose a suitable one.

Now you can access owncloud by http://ip address/owncloud      .
To access your owncloud externally you have to set NAT in your default router.

9. Coming

Posted in NAS, Ubuntu | Leave a comment

Compile OpenWrt in Ubuntu 12.04 and test the result in VMWARE

Compile OpenWrt in Ubuntu 12.04 and test the result in VMWARE:
Environment: Ubuntu 12.04, VMware workstation 9

First update the ubuntu,
 sudo apt-get update
sudo apt-get upgrade

Then installed subversion and other related files
sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl

In the home directory, create a folder, and then use the svn command line to checkout the source code:
mkdir  ~ / openwrt
cd   ~ / openwrt
svn checkout svn :/ / svn.openwrt.org / openwrt / trunk /
cd trunk

Update openwrt:
. / Scripts / feeds update -a

To install all the packages:
. / Scripts / feeds install -a

Then type

make menuconfig

In the kernel configuration interface:

1. Target System (x86) —> (*) x86

2 with the target file system to EXT4
[*] ext4″>Target Images —> [*] ext4
[*] Build VMware image files (VMDK)

To add web access Luci must be added, LuCI -> collection -> select luci

1) type make

The compile time may a little long. After that the finished vmdk file is in the bin/x86 directory.
2) copy the openwrt-x86-generic-combined-ext4.vmdk to WIN7 computer;

Run OpenWRT in Win7 VMWare:

Create a virtual machine

New –> Virtual Machine … –> NEXT–> linux 、ubuntu –“>Open VMware -> New -> Virtual Machine … ->  NEXT -> linux, ubuntu –
NEXT–> you can choose any path for the VM machine–> NEXT–> network -“Use bridged networking” –>  NEXT–> use an existing harddisk- “the one just build-openwrt-x86-generic-combined-ext4.vmdk”–> Finish.

2) Press run button you can start running OpenWRT.

Use your browse, enter 192.168.1.1, you can see in the openwrt web interface.

Note:
A. If your network is not in the 192.168.1.x segment, please change the IP as follows:

# vi/ etc / config / network
Appear as shown press i to modify
Modify the following diagram

After modification
Press [Esc]
Then enter to save and exit
: wq

Followed by restart network
# / etc / init.d / network restart

B. The bridge function in VMWARE is often not very stable. It is better to add a seperation network card to the WIN 7 for the bridge function. Remove all the protocol for the  card , leaving only the vmware bridge protocol. Then the bridge function would be very stable.

Posted in Uncategorized | Tagged , , | Leave a comment

ubuntu 10.0.4 nas and printer server

The steps are as follows.
1. Set up the Ubuntu server version from DVD.

Select SSH, printer server and samba packages.

2.Change SSH so that ROOT can login. Normally it is allowed. You can check this by
nano /etc/ssh-config
making sure “PermitRootLogin” to “yes”.
Before root can login you have to set the root password by
Sudo passwd root

3.Change the network interface IP so that you can login remotely
nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.250
netmask 255.255.255.0
gateway 192.168.1.1

Check the DNS server is correct.
nano /etc/resolv.conf
nameserver 192.168.1.1

4.Now you can use root to ssh from a remote computer and do update and upgrade.
apt-get update
apt-get upgrade

5.To share a new drive, check the dev first
lshw –C disk
this will display the disks available

To fdisk and format the disk
fdisk /dev/sd* (type the number for your disk for the *)
mkfs –t ext4

Make a directory first and then mount the disk
mkdir   /media/nas
mount /dev/sd*1      /media/nas

To mount it automatically when start edit the fstab file
nano /etc/fstab

Add a line to the end of the file
/dev/sd*1  /media/nas  ext4   defaults  0   0

6.For the samba section
nano /etc/samba.conf

In the globe and share sections
[globe]
dos charset= cp950    (for traditional chinese only)
hosts  allow= 127.0.0.1 192.168.1.0/24
hosts deny = 0.0.0.0/0

[share]
comment=share to all
path=/media/has/share
browseable =yes
read only = no
create mask =0664
directory mask= 0664

7.Share printer
nano /etc/cups/cupsd.conf

Change listen localhost:631 to listen 192.168.1.250:631

Add allow @Local to the three sections

<Location />
Order allow,deny
Allow @LOCAL
</Location>

<Location /admin>
Order allow,deny
Allow @LOCAL
</Location>

# Restrict access to configuration files…
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow @LOCAL
</Location>

To restart the cupsd service tpye
/etc/init.d/cups restart
Now use a browser to search print, add printer and share printer from a remote computer type
http://192.168.1.250:631/printers

.

Posted in Uncategorized | Leave a comment

FreeNAS (0.7.2) Print Server Setup Guide

Description of System
I currently have a FreeNAS (0.7.2) system which is used to support data sharing with other family members. This is running samba to serve files around the house. I am using an Brother 5150D printer with USB interface. The server is to carry out spooling functionality only – no formatting. Print formatting is to be carried out by the clients, all running Windows 7 and XP. There are no changes required to the FreeNAS system hardware setup.
I am using the FULL version with FreeNAS running from a 1TB HD with OS in a partition and data in another partition. I have used exactly the same instructions as described previously by contributors who use the installation from a LiveCD.

Important Notes
These instructions are tested for FreeNAS version 0.7.2 only
To setup the required printing services on XP clients you must have access to your original Microsoft installation disk. You will need to use an SSH connection to access the FreeNAS system during the build. I used WINSCP and a Windows version of PuTTy on my Windows 7 client.
When you connect using the SSH console you should login as root. Your password will be the same as used during a normal FreeNAS login.
These instructions are based on the printer connecting via a USB connection.

1 – Setup the USB printer driver( the ulpt.ko file)
Use WINSCP to connect to the FreeNas
Copy the file ulpt.ko (FreeBSD 7.3 version) to the directory /boot/kernel

2 –Setup LPRng Spooler.Setup LPRng Configuration Files
In the command line of WINSCP, type

pkg_add -r LPRng

to install the package

3. Configure Things to Load on Boot

In winscp edit the file loader.conf in the folder /boot/defaults/
Scroll down until you reach a section titled “USB Modules”
Change the line
“ulpt_load=”NO” # Printer”
to
“ulpt_load=”YES” # Printer”
4. Start LPRng
Navigate to the FreeNAS web interface in a browser. Then go to System–>Advanced–>rc.conf
Use the “+” button to add two new entries:

Name: lpd_enable
Value: NO

Name: lprng_enable
Value: YES

5 –Setup LPRng Configuration Files

There are three main files that contribute to LPRng working properly.
– /etc/printcap
– /usr/local/etc/lpd.perms
– /usr/local/etc/lpd.conf

(i) printcap

The sample printcap file

# @(#)printcap Brother HL-5150D

lp|brother:\
:sd=/var/spool/lpd/bare:\
:sh:\
:lp=/dev/ulpt0:
#

Then make a directory for spooling and change a suitable right

In a command prompt type

mkdir -p -m 700 /var/spool/lpd/bare

and

chown 1:1 /var/spool/lpd/bare

(ii) lpd.perms
The default file should be OK.

(iii)lpd.conf
The default file should be fine.

6 – Prepare The File Needed To Start The Spooler Daemon (lpd).
We’re going to want to start up the proper LPRng processes when a printer is connected.
In Winscp edit or create a file devd.conf in /usr/local/etc/devd/
Add to the file:

# start action when USB printer ulpt0 is plugged in
# wait 3 second and then start the spooler daemon
#
attach 100 {
device-name “ulpt0”;
action “sleep 3; lpd;
checkpc -f;
chown 0:0 /dev/ulpt0;
chmod 666 /dev/ulpt0;
echo ‘o5L25fgfab’ > /dev/speaker;”;
};
*/

7 – Final Checks
Reboot FreeNAS. When you hear the normal ‘beep’ to indicate FreeNAS is up and running, unplug your printer and plug it in again so that the system will “see” it again. If everything is setup properly, after about 3 seconds, you should hear a different musical “bleep” which is the acknowledgement that the lpd daemon is running.
Now use the SSH console to check out a few things:

checkpc –f
This should show if any configuration file is not correct or not loaded properly.
top
You should be able to see the lpd daemon running. Ctrl+C will stop this.
lpc lpd
Gives you the PID of lpd or signals an error if lpd is not loaded.
lpq
Should return the status of the empty spool queue.
lpc status
Should show the queue and the spooler status.
ll /dev/u*
should show ulpt0 setup for read-write for user, group, root. These command will also give you a hint on where problems might be – in case you have any.

8 – Add Required Windows Components on A Windows XP Client PC

Windows XP does provide a built-in Unix LPR client, however you have to load some additional facilities from the XP setup disk.
(This is where these instructions differ from previous documentation).

On your XP machine select Start | Control Panel | Add or Remove Programs.
Select Add or Remove Windows Components (it is an icon on the left task bar).
Tick the option for Management & Monitoring Tools.
Tick the option for Other Network File & Print Services and click Next

You will probably be asked to insert your XP disk at this stage.
Once the additional components have been loaded, click Finish.
This should install the Unix LPR port that we need.

9 – Setup A New Printer – For Windows XP Client PCs

You need to setup your XP machine to use its Windows driver. This will prepare the necessary print file on your Win XP client and spool it over the network to your FreeNAS print server.
On your XP machine select Start | Control Panel | Printers & Faxes.
Step 2 – Select a port
If you can’t add LPR – either you have already set this up and need to use the existing LPR with the required FreeNAS IP address, or you haven’t loaded the LPR facility from the Windows setup disk.

Step 3 – Setup LPR parameters – Inserting the FreeNAS network address and “lp”.

Now choose a pre-defined printer, or insert your manufacturers disk. Remembering this is the Windows driver you are adding.
Now try and print something from your Windows XP client, using the newly added printer. If your printer connected to FreeNAS now prints correctly, then this is the task completed.
10 – Add Required Windows Components on A Windows 7 Client PC
The printer drivers you use here are the Windows drivers.
On the Windows 7 machine select Start | Control Panel | Programs.
Select Turn Windows Features On/Off.
Go to Print Services and expand the + box.
Select (by adding a tick) LPR Port Monitor and click Next

You will now have to wait whilst Windows 7 adds the required components (it can take a while).
Once the additional components have been loaded, click Finish.
The Unix LPR port will now be installed.

11 – Setup A New Printer – For Windows 7 Client PCs
I suggest leaving old printers unchanged and add a new printer.
You need to setup the Windows 7 machine to use its Windows driver. This will prepare the necessary print file on your client and spool it over the network to your FreeNAS print server.
On the Windows 7 PC select Start | Control Panel | Programs.
Step 1 – Add a new printer – Using the Local Printer option

Step 2 – Select a port
If you can’t add LPR – either you have already set this up and need to use the existing LPR with the required FreeNAS IP address, or you have missed the step to add the LPR facility from the Windows 7 system.

Step 3 – Setup LPR parameters – Inserting the FreeNAS network address and “lp”.

Now choose a pre-defined printer, or insert your manufacturer disk. Remembering this is the Windows driver you are adding.
Finally check the printer test page works correctly.

12 – Summary
The simplicity of FreeNAS remains intact and the boot sequence is completely automatic. You can turn this facility on or off by adding or removing the commands from FreeNAS.
It has the bonus of giving wireless printing capability if you have a wireless router in the setup.
Important Warnings
Remember to start the FreeNAS server before powering up your printer, or alternatively just turn the printer off and on to register the printer with the spooler daemon.

This note is collected from a number of sources. I have just refined these to hopefully provide a simplified guide.
Best Luck!

Posted in Uncategorized | Leave a comment