Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save masamitsunamioka/b51f96835d348715dc3f5fa882d785cb to your computer and use it in GitHub Desktop.
Save masamitsunamioka/b51f96835d348715dc3f5fa882d785cb to your computer and use it in GitHub Desktop.
CentOS-7-VirtualBox

CentOS-7-x86_64-1708

Disk/Volume

volgroup00
	disk-00.xxx - disk-0f.xxx
  /
  swap

volgroup10
	disk-10.xxx - disk-1f.xxx
  /home

:
volgroupff
    disk-f0.xxx - disk-ff.xxx

Install CentOS

  • minimal
  • root password

Network

# nmcli d
# nmtui

Initial Install/Update

# yum install kernel-devel gcc -y
# yum update -y
# shutdown -r now

Rename VolumeGroup

# vgdisplay
# vgrename centos volgroup00
# find /{boot,etc} -type f | xargs grep -E "centos-(root|swap)"

### Replace volume name (/boot/grub2/grub.cfg).
# cd /boot/grub2
# cp -p grub.cfg grub.cfg_original
# sed -i -e 's|centos-root|volgroup00-root|g' grub.cfg
# sed -i -e 's|centos-swap|volgroup00-swap|g' grub.cfg
# sed -i -e 's|centos/root|volgroup00/root|g' grub.cfg
# sed -i -e 's|centos/swap|volgroup00/swap|g' grub.cfg
# diff grub.cfg_original grub.cfg

### Replace volume name (/etc/fstab).
# cd /etc
# cp -p fstab fstab_original
# sed -i -e 's|centos-root|volgroup00-root|g' fstab
# sed -i -e 's|centos-swap|volgroup00-swap|g' fstab
# diff fstab_original fstab

### Reboot here.
# shutdown -r now

Separate volume for /home

# fdisk -l
# fdisk /dev/sdb
  m
  n
    p
    default 1
    default 2048
    default 62914559
  w
# pvcreate /dev/sdb1
# vgcreate volgroup10 /dev/sdb1   #vgextend volgroup00 /dev/sdb1
# lvcreate -l +100%FREE -n /dev/volgroup10/home volgroup10
# mkfs.xfs /dev/volgroup10/home
# vi /etc/fstab
# diff /etc/fstab_original /etc/fstab
9c9,10
< /dev/mapper/centos-root /                       xfs     defaults        0 0
---
> /dev/mapper/volgroup00-root /                       xfs     defaults        0 0
> /dev/mapper/volgroup10-home /home                   xfs     defaults        0 0
11c12
< /dev/mapper/centos-swap swap                    swap    defaults        0 0
---
> /dev/mapper/volgroup00-swap swap                    swap    defaults        0 0
#
# shutdown -h now

Take Snapshot 1

  • VBoxGuestAdditions.iso

Guest Additions

# yum install bzip2 -y
# mkdir /media/cdrom
# mount -t iso9660 /dev/cdrom /media/cdrom
# sh /media/cdrom/VBoxLinuxAdditions.run
# shutdown -r now

KDE

# yum groupinstall "KDE Plasma Workspaces" -y
# yum update -y
# shutdown -h now

Take Snapshot 2

Add groups and users

# groupadd masamitsu
# useradd -D
# useradd -g masamitsu masamitsu
# passswd masamitsu
# visudo
# shutdown -r now

Fonts

# /usr/bin/sudo /usr/bin/yum localinstall http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
# /usr/bin/sudo /usr/bin/sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/nux-dextop.repo
# /usr/bin/sudo /usr/bin/yum --enablerepo=nux-dextop install fontconfig-infinality cairo libXft freetype-infinality
# shutdown -r now

Google Chrome

### https://www.google.com/chrome/
# yum install libappindicator-gtk3
# rpm -ivh google-chrome-stable_current_x86_64.rpm
# shutdown -r now

Fonts (Inconsolata)

###  https://intellij-support.jetbrains.com/hc/en-us/community/posts/206601305-Solved-Inconsolata-font-display-problems
###  https://fonts.google.com/specimen/Inconsolata?selection.family=Inconsolata
# fc-cache -frv
# shutdown -h now

Take Snapshot 3

TODO

  • timezone

yum install lsb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment