vbox下安装archlinux

博主linux小白一个,一直想试试archlinux,最近终于有时间了,一番努力之后成功了,写出来与大家分享。

archlinux版本 2013.06.01.

archlinux的优点就不说了,百度之流的都写得很详细了,我觉得最大的优点就是简洁,不过也太简洁了。。。连个图形界面的安装都没有。

步入正题,这是我的参考文档。

https://wiki.archlinux.org/index.php/Beginners%27_Guide_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29

大体上可以按着他的教程一步一步来,不过可能由于是在虚拟机中安装,好多地方需要改变下。

1、下载镜像后,新建个虚拟机,以镜像启动。

2、语言什么的就不用管了,默认的都是对的。

3、关于网络,因为是虚拟机,所以现在不用配置,但是后面是必需配置的。

4、硬盘分区,这步比较重要,虚拟机的硬盘好像不大一样。建议将“/”和“/home”分成两个区,分区按照他的来就行。

MBRcfdisk /dev/sdaRoot:
  • Choose New (or press N) – Enter for Primary – type in "15G" – Enter for Beginning – Enter for Bootable.

Home:

  • Press the down arrow to move to the free space area.
  • Choose New (or press N) – Enter for Primary – Enter to use the rest of the drive (or you could type in the desired size).
GPTcgdisk /dev/sdaRoot:
  • Choose New (or press N) – Enter for the first sector (2048) – type in "15360M" – Enter for the default hex code (8300) – Enter for a blank partition name.
Home:
  • Press the down arrow a couple of times to move to the larger free space area.
  • Choose New (or press N) – Enter for the first sector – Enter to use the rest of the drive (or you could type in the desired size; for example "30G") – Enter for the default hex code (8300) – Enter for a blank partition name.

5、硬盘格式化,他给的命令好像虚拟机硬盘不支持,所以

# mkfs -t ext2 /dev/sda1
# mkfs -t ext2 /dev/sda2
6、挂载分区,这个没问题。

# lsblk /dev/sda
# mount /dev/sda1 /mnt
# mkdir /mnt/home
# mount /dev/sda2 /mnt/home

7、选择安装镜像,这步不建议改,博主就换了个学校的源,但是不是官方的,而且好像少了什么东西,然后签名不通过,总之不能用。

8、安装基本系统也是没问题的。

# pacstrap /mnt base base-devel
# pacman-key --init && pacman-key --populate archlinux 
9、生成fstab,fstab是linux启动过程中的硬盘分区表,随眼他说都行,但是博主测试只能用标签选项

# genfstab -U -p /mnt >> /mnt/etc/fstab
# nano /mnt/etc/fstab
10、Chroot到新系统。前面正确的话,这步就可以切换到安装的系统了。

# arch-chroot /mnt
11、配置系统,这里的都没问题。
nano /etc/locale.gen
en_US.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
# locale-gen
nano /etc/locale.conf
LANG=zh_CN.UTF-8
LC_TIME=en_GB.UTF-8
nano /etc/vconsole.conf
KEYMAP=us
FONT=
# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# hwclock --systohc --utc
nano /etc/modules-load.d/virtio-net.conf
# Load virtio-net.ko at boot
virtio-net
# echo myhostname > /etc/hostname

12、配置网络,这里不可以省略了。由于是虚拟机,所以

# systemctl enable dhcpcd@eth0.service
# cd /etc/netctl
# cp examples/ethernet-dhcp my-network
# nano my-network
# netctl enable my-network
13、设置root密码

# passwd
14、安装启动器,网上说可能遇到各种问题,我运气好,啥都没遇到。。

# pacman -S grub-bios
# grub-install --recheck /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
15、卸载分区,重启系统。
# exit
# umount /mnt/{boot,home,}
# reboot
到此为止,你就有了一个可以在虚拟机里用的archlinux了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值