Skip to content

CloudSen/archlinux_installer_vm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARCH LINUX INSTALLER FOR VIRTUAL MACHINE

Semi-automatic

CAUTION

This script is for:

  • Version: Arch Linux 2020.07.01 or later
  • Container: VMware(Not yet tested on hardware)
  • Boot Mode: BIOS
  • Network Status: Online

HOW TO USE

Load arch linux live ISO, then download release file:

curl -sL https://github.com/CloudSen/archlinux_installer_vm/archive/<release-version>.tar.gz -o <release-version>.tar.gz

Decompression <release-version>.tar.gz:

tar zxf <path to .tar.gz>

Move to shell directory:

cd <path to shell>

Give the script permission to execute:

find . -name "*.sh" -execdir chmod +x {} +

Check and modify configuraion file:

vim conf/config.sh

Run init shell:

./init.sh

After reboot run install shell:

cd /archlinux_installer_vm
find . -name "*.sh" -execdir chmod +x {} +
./install.sh

Check log files: log/info.log and log/error.log

CONFIGURATION FILE

You must specify:

  • new username
  • new user password
  • root password
  • grub install path
#!/bin/bash
# Author: CloudS3n https://yangyunsen.com
# Description: Configuraion file

# 0:LAN 1:WIFI
netType=0

# Host name, /etc/hostname
hostName="GLaDOS"

# User info
## new username
username=""
## new user password
password=""
## root password
rootPassword=""

# Where to install grub, u can check by "fdisk --list"
grubDevice="/dev/sda"

# Automically Partition
# Defalut partition:
# /        20G
# /home    Remaining capacity
## Whether partition disk automatically
enableAutoPartition=true
## Where to install arch, only work when enableAutoPartition is true
autoPartitionDevice="/dev/sda"
## Partition size
homePartitionSize="+10G"
rootPartitionSize="+20G"

# Whether install graphic environment
enableGraphic=true
# Essential soft, separated by space。
# If using Intel CPU, then specify "intel-ucode", If using AMD CPU, then specify amd-ucode
coreSoft="vim dialog wpa_supplicant ntfs-3g networkmanager network-manager-applet screenfetch intel-ucode grub"
# What u want to install, separated by space.
dailySoft="git"
# If u want smallest system, then remove "kde-applications"
graphicEnvironment="xorg plasma kde-applications sddm"
vmTools="gtkmm3 open-vm-tools xf86-input-vmmouse xf86-video-vmware"

WHAT WILL BE INSTALLED

Pre-install:

  • Arch Linux: base base-devel linux linux-firmware
  • vim
  • dialog
  • wpa_supplicant
  • ntfs-3g
  • networkmanager
  • network-manager-applet
  • screenfetch
  • intel-ucode
  • grub

Post-install:

  • The soft list specified in config.sh

SUCCESS INSTALL FULL INFO LOG

[MODE-CHECK] --------------------
[ PRE-INSTALL ] Your Boot Mode is BIOS
[SET-NET] --------------------
[ PRE-INSTALL ] Enable LAN...
[ PRE-INSTALL ] Connect to www.baidu.com
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Connection: keep-alive
Content-Length: 277
Content-Type: text/html
Date: Sun, 26 Jul 2020 17:20:02 GMT
Etag: "575e1f72-115"
Last-Modified: Mon, 13 Jun 2016 02:50:26 GMT
Pragma: no-cache
Server: bfe/1.0.8.18

[ PRE-INSTALL ] You are online
[SET-TIME] --------------------
[ PRE-INSTALL ] Before set system time:
                Time zone: UTC (UTC, +0000)           
[ PRE-INSTALL ] After set system time:
                Time zone: Asia/Shanghai (CST, +0800) 
[PARTITION] --------------------
[ PRE-INSTALL ] Automically partitioning /dev/sda...
[ PRE-INSTALL ] rootPartitionSize = +20G...
[ PRE-INSTALL ] Formating partitions...
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: c5aefc0a-38bc-46c8-860e-bcd78c192eaf
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000

Allocating group tables:   0/160�������       �������done                            
Writing inode tables:   0/160�������       �������done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:   0/160�������       �������done

mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 2621184 4k blocks and 655360 inodes
Filesystem UUID: f4c39d29-2bdb-4f22-98b2-c354a967556f
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables:  0/80�����     �����done                            
Writing inode tables:  0/80�����     �����done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information:  0/80�����     �����done

[ PRE-INSTALL ] Mounting partitions...
[MIRROR-LIST] --------------------
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################

# With:       reflector --verbose --country China --sort rate --save /etc/pacman.d/mirrorlist
# When:       2020-07-26 17:24:11 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2020-07-26 17:24:05 UTC
# Last Check: 2020-07-26 16:35:44 UTC

Server = https://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch
Server = http://mirrors.163.com/archlinux/$repo/os/$arch
Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
Server = http://mirrors.zju.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch
Server = rsync://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch
Server = http://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch
Server = http://mirror.lzu.edu.cn/archlinux/$repo/os/$arch
Server = rsync://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
Server = http://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch
Server = rsync://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch
[PACSTRAP] --------------------
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda1
UUID=c5aefc0a-38bc-46c8-860e-bcd78c192eaf	/         	ext4      	rw,relatime	0 1

# /dev/sda2
UUID=f4c39d29-2bdb-4f22-98b2-c354a967556f	/home     	ext4      	rw,relatime	0 2

[COPY-SCRIPT] --------------------
[ PRE-INSTALL ] Copy shell to /mnt/archlinux_installer_vm
[INSTALL-CORE-SOFT] --------------------
[ PRE-INSTALL ] Install core soft...
[CONFIG-SYSTEM] --------------------
[ PRE-INSTALL ] Setting localtime...
[ PRE-INSTALL ] Setting locale.gen...
Generating locales...
  en_US.UTF-8... done
  zh_CN.UTF-8... done
  zh_HK.UTF-8... done
  zh_TW.UTF-8... done
Generation complete.
[ PRE-INSTALL ] Setting hostname GLaDOS ...
GLaDOS
[ PRE-INSTALL ] Setting hosts ...
127.0.0.1 localhost
::1       localhost
127.0.0.1 GLaDOS.localdomain GLaDOS
[CONFIG-USER] --------------------
[ PRE-INSTALL ] Changing root passwd to cloudsen ...
[ PRE-INSTALL ] Creating user clouds3n with passwod cloudsen ...
[CONFIG-GRUB] --------------------
Installing for i386-pc platform.
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
done
[PRE-INSTALL-DONE] --------------------
�[0m�[1;36m                   -`                 �[0m
�[0m�[1;36m                  .o+`                �[0m�[1;36m root�[0m�[1m@�[0m�[0m�[1;36marchiso�[0m
�[0m�[1;36m                 `ooo/                �[0m�[1;36m OS:�[0m Arch Linux �[0m
�[0m�[1;36m                `+oooo:               �[0m�[1;36m Kernel:�[0m x86_64 Linux 5.7.6-arch1-1�[0m
�[0m�[1;36m               `+oooooo:              �[0m�[1;36m Uptime:�[0m 9m�[0m
�[0m�[1;36m               -+oooooo+:             �[0m�[1;36m Packages:�[0m 262�[0m
�[0m�[1;36m             `/:-:++oooo+:            �[0m�[1;36m Shell:�[0m init�[0m
�[0m�[1;36m            `/++++/+++++++:           �[0m�[1;36m Disk:�[0m 2.8G / 34G (9%)�[0m
�[0m�[1;36m           `/++++++++++++++:          �[0m�[1;36m CPU:�[0m Intel Core i7-8700K @ 3.696GHz�[0m
�[0m�[1;36m          `/+++o�[0m�[36moooooooo�[0m�[1;36moooo/`        �[0m�[1;36m GPU:�[0m VMware SVGA II Adapter�[0m
�[0m�[36m         �[0m�[1;36m./�[0m�[36mooosssso++osssssso�[0m�[1;36m+`       �[0m�[1;36m RAM:�[0m 598MiB / 7931MiB�[0m
�[0m�[36m        .oossssso-````/ossssss+`      �[0m
�[0m�[36m       -osssssso.      :ssssssso.     �[0m
�[0m�[36m      :osssssss/        osssso+++.    �[0m
�[0m�[36m     /ossssssss/        +ssssooo/-    �[0m
�[0m�[36m   `/ossssso+/:-        -:/+osssso+-  �[0m
�[0m�[36m  `+sso+:-`                 `.-/+oso: �[0m
�[0m�[36m `++:.                           `-/+/�[0m
�[0m�[36m .`                                 `/�[0m
[PRE-INSTALL] Done
[PRE-INSTALL] You can check installation log in /archlinux_installer_vm/log/
[PRE-INSTALL] If everything is ok, then exit chroot and reboot system, and manually run install.sh
[INSTALL-DAILY-SOFT] --------------------
[ POST-INSTALL ] Install pop-soft...
[ POST-INSTALL ] Install graphic env...
[ POST-INSTALL ] Install vmware tools...
[CONFIG-SYSTEMD] --------------------
[ POST-INSTALL ] Enable dhcpcd
[ POST-INSTALL ] Enable sddm
[ POST-INSTALL ] Enable NetworkManager
[ POST-INSTALL ] Enable vmtools
[POST-INSTALL-DONE] --------------------
Unit dhcpcd.service could not be found.
● sddm.service - Simple Desktop Display Manager
     Loaded: loaded (/usr/lib/systemd/system/sddm.service; enabled; vendor preset: disabled)
     Active: inactive (dead)
       Docs: man:sddm(1)
             man:sddm.conf(5)
● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled)
    Drop-In: /usr/lib/systemd/system/NetworkManager.service.d
             └─NetworkManager-ovs.conf
     Active: active (running) since Mon 2020-07-27 01:38:06 CST; 14min ago
       Docs: man:NetworkManager(8)
   Main PID: 8323 (NetworkManager)
      Tasks: 3 (limit: 9495)
     Memory: 12.0M
     CGroup: /system.slice/NetworkManager.service
             └─8323 /usr/bin/NetworkManager --no-daemon

Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4759] device (ens33): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4769] device (ens33): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4784] manager: NetworkManager state is now CONNECTED_LOCAL
Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4811] manager: NetworkManager state is now CONNECTED_SITE
Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4816] policy: set 'Wired connection 1' (ens33) as default for IPv4 routing and DNS
Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4846] device (ens33): Activation: successful, device activated.
Jul 27 01:38:07 GLaDOS NetworkManager[8323]: <info>  [1595785087.4875] manager: startup complete
Jul 27 01:38:09 GLaDOS NetworkManager[8323]: <info>  [1595785089.1422] manager: NetworkManager state is now CONNECTED_GLOBAL
Jul 27 01:48:28 GLaDOS NetworkManager[8323]: <info>  [1595785708.7649] manager: NetworkManager state is now CONNECTED_SITE
Jul 27 01:48:29 GLaDOS NetworkManager[8323]: <info>  [1595785709.3958] manager: NetworkManager state is now CONNECTED_GLOBAL
● vmtoolsd.service - Open Virtual Machine Tools (VMware Tools)
     Loaded: loaded (/usr/lib/systemd/system/vmtoolsd.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-07-27 01:52:28 CST; 2s ago
   Main PID: 15969 (vmtoolsd)
      Tasks: 3 (limit: 9495)
     Memory: 2.2M
     CGroup: /system.slice/vmtoolsd.service
             └─15969 /usr/bin/vmtoolsd

Jul 27 01:52:28 GLaDOS systemd[1]: Started Open Virtual Machine Tools (VMware Tools).
● vmware-vmblock-fuse.service - Open Virtual Machine Tools (vmware-vmblock-fuse)
     Loaded: loaded (/usr/lib/systemd/system/vmware-vmblock-fuse.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-07-27 01:52:29 CST; 2s ago
   Main PID: 15994 (vmware-vmblock-)
      Tasks: 3 (limit: 9495)
     Memory: 780.0K
     CGroup: /system.slice/vmware-vmblock-fuse.service
             └─15994 /usr/bin/vmware-vmblock-fuse -d -f -o subtype=vmware-vmblock,default_permissions,allow_other /run/vmblock-fuse

Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    max_readahead=0x00020000
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    max_write=0x00020000
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    max_background=0
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    congestion_threshold=0
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    unique: 2, success, outsize: 40
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]: unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 16098
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]: getattr /
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    unique: 4, success, outsize: 120
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]: unique: 6, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 16098
Jul 27 01:52:31 GLaDOS vmware-vmblock-fuse[15994]:    unique: 6, success, outsize: 96
[POST-INSTALL] Done
[POST-INSTALL] You can check installation log in /archlinux_installer_vm/log/
[POST-INSTALL] Enjoy your new system! ;)