VMware Tools

VMware Tools should be one of the first things installed on a ESXi VM. According the VMware, it’s a suite of utilities that enhances the performance of hte VM’s guest operating system and improves management of the VM.

sudo nano /etc/apt/sources.list

Add the following to the bottom of the sources list.

deb http://ftp.debian.org/debian/ jessie main contrib

Update and install.

sudo apt-get update
sudo apt-get install open-vm-tools

Check ESXi to ensure VMware Tools has been installed properly.

Advertisements

Sudo

One of the first things I install on a server is sudo. It’s pretty well documented that it isn’t wise to always use su. I’ve also noticed using sudo forces me to constantly double check what I do so that’s a good side effect.

Get into superuser mode, install sudo.

 su
apt-get install sudo
visudo

Add the user you want into sudo by replacing ‘newuser’

# User privilege specification
root        ALL=(ALL:ALL) ALL
newuser    ALL=(ALL:ALL) ALL

Screenfetch

Screenshot from 2017-07-08 00-16-55

I’ve deployed a test VM to try out a bunch of things before I implement it. I went with Debian because I’m more familiar with it than Ubuntu, it’s well documented, and it just recently got updated to 9.0 Stretch! I kind of dropped the ball on documenting how to deploy a VM in ESXi… Oh well, another day.

Screenfetch

What’s the point of having a homelab without a little fun?
First update your server

 sudo apt-get update
sudo apt-get upgrade

Install screenfetch, cd into /etc/, then edit bash.bashrc.

sudo apt-get install screenfetch
cd /etc/
sudo nano bash.bashrc

Add ‘screenfetch’ to the bottom so it starts whenever you open a terminal.

Arch Linux with Windows 10 Dual Boot

I’ve installed and reinstalled Arch Linux about 4 times now over the past 2-3 months since getting my ThinkPad x220. I’ve been an on and off Linux user for a few years now, but I hardly used the CLI except in cases where I couldn’t use a GUI to do what I needed to do. While setting up my R710 (which I need do a writeup on..) with ESXi and Windows, I’ve had plans in my head to fully convert to Linux for a while. I just didn’t have the balls to fully commit because it would leave my server in a state of chaos for months while I try and figure out how to fully utilize Linux. That’s where Arch came in. It was advertised as a Linux system I could build to meet whatever I needed and also forced the user to dive into the command line to install everything. Seems fitting to learn the inner workings of Linux.

I want to start out the installation guide by saying this is my setup and you shouldn’t follow it step by step because it probably won’t work for you. This is just a guide to see what I did so you can craft your own Arch Linux setup. Read the official installation guide, it’s the most complete guide on Arch you’ll ever read. It’ll go much more in-depth on topics than I ever will. That being said, when I did my first Arch install I had YouTube tutorials up and a bunch of other guides as references while following the guide and wrote notes along the way so I can go back on them to figure out what I did or what went wrong to fix it. It always helps to have references!

1. Dual Booting Windows 10

I use my x220 primarily for school so my setup involves dual booting Windows 10. I hardly use the Win10 partition, but Linux is obviously not widely adopted in the world so it’s comforting to know I have something else to fall back on ‘just in case’. I created a 100GB partition and installed Win10 on it. The rest of my 250GB SSD was for Arch.

2. Prep

Ensure that your ethernet cable is connected. Download the latest Arch ISO and create a bootable USB. You can use dd on Linux or Rufus if you’re on Windows. From your bios settings, select to boot from USB.

3. Verify the Boot Mode

#efivar -l

If the output is normal and lists a bunch of UEFI variables, it is booted in UEFI mode.

4. Check if Connected to the Internet

#ping archlinux.org

[CTRL+C] to stop pinging

5. Update the System Clock

#timedatectl set-ntp true
#timedatectl status

6. Partitioning the Disks

fdisk -l
cfdisk /dev/sda
mkfs.ext4 /dev/sda6
mount /dev/sda6 /mnt

List out all the disks available. Make note of which disk you’re going to use – in my case it was /dev/sda. Create a partition for Arch & Swap File using cfdisk. mkfs.ext4 will format whatever partition you want to ext4 file format. Lastly, mount it to /mnt.

7. Swap File

The general ‘rule of thumb’ has been for the swap file to be half of however much ram you had. On most modern systems there is plenty of ram to go around and a swap file isn’t needed, but I included it anyways because why not? Allocating 2gb to swap won’t hurt and better safe than sorry.

mkswap -L "Linux Swap" /dev/sda5
swapon /dev/sda5
free -m

Check if swap has been turned on.

8. Installing Base Packages

pacstrap /mnt base base-devel

9, Mount the EFI Partition

mkdir -p /mnt/boot/efi
fdisk -l /dev/sda
mount /dev/sda2 /mnt/boot/efi

Check which partition the EFI is on, in my case it was ‘2’

10. Generate the fstab file

genfstab -p /mnt >> /mnt/etc/fstab
sudo nano /mnt/etc/fstab

Use nano to check the fstab file just incase of errors

11. Chroot

arch-chroot /mnt

Chroot into your new system!

12. Timezone

ln -sf /usr/share/zoneinfo/Canada/Eastern /etc/localtime
hwclock --systohc

Set the time zone, then run hwclock to generate /etc/adjtime

13. Locale

nano /etc/locale.gen
locale-gen

Find ‘en_US.UTF-8 UTF-8’ and uncomment, then generate the locale

14. Hostname

sudo nano /etc/hostname

Add your desired hostname.

15. Enable Networking

systemctl enable dhcpcd

16. Root Password

passwd

17. Generate initial RAM disk

mkinitcpio -p linux

18. GRUB – Bootloader

Since this system is being dual booted with Windows, we have to install a bootloader. My choice is GRUB.

pacman -Syu grub efibootmgr os-prober
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
ls -l /boot/efi/EFI/arch/

Generate the grub configuration, then confirm that grub has been installed

19. Create a User Account

useradd -m -g users -s /bin/bash 'nn'
passwd nn
sudo EDITOR=nano visudo

Add a user, in this case it’s ’nn’, create password for user, then add user to sudo. Scroll down to ‘Root’ and press insert, then type…

’nn ALL=(ALL) ALL’

20. Install terminator and sudo

Two basic packages need to be installed before rebooting into the system.

pacman -Syu
pacman -S terminator sudo
reboot

21. Add Windows to GRUB

Once rebooted into Arch, you should login as whatever user you made.

su
pacman -Syu
grub-mkconfig -o /boot/grub/grub.cfg

Log in as root, update Arch, then add Windows to GRUB.

22. Intel Microcode

As I have an Intel CPU, I need to enable microcode updates.

sudo pacman -S intel-ucode
sudo grub-mkconfig -o /boot/grub/grub.cfg

Verify that the microcode got updated on boot.

dmesg | grep microcode

Final Words

And that’s it! You should have a fully functioning Arch install to play around in. This is an extremely barebones setup as it was just my basic installation notes. In future posts, I’ll explain how to setup other packages and my Arch setup more in depth.