网站首页 > 开源技术 正文
首先下载虚拟机版本:https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-virt-3.14.0-x86_64.iso
然后在VirtualBox新建一台虚拟机,类型为Linux,版本为Linux 2.6 / 3.x / 4.x (64-bit)。在存储中加载alpine-virt-3.14.0-x86_64.iso镜像文件。启动虚拟机,使用root登陆,执行setup-alpine进行安装,选择每个问题如下,中间有任何问题可ctrl+c重新开始安装。
select keyboard layout [none]:
Enter system hostname (short form, e.g. 'foo') [localhost]:
Which one do you want to initialize?(or '?' or 'done') [eth0]:
Ip address for eth0?(or 'dhcp', 'none','?') [dhcp]:
Do you want to do any manual network configuration?[no]:
Changing password for root
New Password: ********
Retype Password: ********
Which timezone are you in? ('?' for list) [UTC]: Asia/Shanghai
HTTP/FTP proxy URL?
Enter mirror number (1-35) or url to add (or r/f/e/done) [f]: e
https://mirrors.ustc.edu.cn/alpine/latest-stable/community
https://mirrors.ustc.edu.cn/alpine/latest-stable/main
https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/community
https://mirror.tuna.tsinghua.edu.cn/alpine/latest-stable/main
:wq
编辑并保存镜像地址
Which ssh server?('openssh' , 'dropbear' or 'none') [openssh]:
Which ntp client to run ? ('busybox' , 'openntpd' , 'chorony' or 'none') [chrony]:
Available disks are:
sda (20 GB ATA VBOX HARDDISK)
Which disk(s) would you like to use? (or '?' or help or 'none') [none]: sda
The following disk is selected:
sda (20 GB ATA VBOX HARDDISK)
How would you like to use it? ('sys', 'data' , 'lvm' or '?' for help) [?]: sys
sys:把系统安装到硬盘上面
WARNING: The following disk(s) will be erased:
sda (20 GB ATA VBOX HARDDISK)
WARNING: Erase the above disk(s) and continue? [y/N]: y
安装完系统之后可先增加一个非root帐号供以后使用:adduser。
使用VirtualBox的共享目录需安装GuestAddition。Alpine Linux虚拟机版本自带GuestAddition,可通过apk命令安装:
apk add virtualbox-guest-additions virtualbox-guest-modules-virt
安装完成之后,重启系统,将共享文件夹映射到文件系统中:
modprobe -a vboxsf
mount -t vboxsf vbox_shared /mnt/outside
其中vbox_shared是通过VirtualBox共享文件夹添加的共享文件夹的名字。
启动自动挂载共享目录:vim /etc/fstab,增加:vbox_shared /mnt/outside vboxsf defaults 0 0
当安装virtualbox-guest-modules-virt可能会提示找不到,需要编辑/etc/apk/repositories,增加:http://dl-cdn.alpinelinux.org/alpine/v3.12/community,因为3.14版本还没有,可以通过下面这个地址查询确认:
https://pkgs.alpinelinux.org/packages?name=virtualbox-guest-modules-virt&branch=v3.14&repo=community
上面的源也可修改为国内的:
http://mirrors.ustc.edu.cn/alpine/v3.12/main
http://mirrors.ustc.edu.cn/alpine/v3.12/community
增加完之后,执行:apk update,然后重新安装:apk add virtualbox-guest-additions virtualbox-guest-modules-virt
其他版本的客户端可通过安装VBoxGuestAdditions.iso来完成,它是VirtualBox自带的,可在安装目录下找到,通过在设置,存储下面增加该iso映像文件,然后在虚拟机中执行:mkdir /mnt/cdrom/ ; mount /dev/cdrom /mnt/cdrom,读取映像文件内容并执行:./VBoxLinuxAdditions.run完成安装。
若:df -h找不到挂载的光盘,可执行:ls -l /dev/cdrom 找到光驱的实际表示然后重新挂载。
若挂载的时候提示:failed: Invalid argument,则可能是未指定文件类型,重新执行:mount -t iso9660 /dev/cdrom /mnt/cdrom。然后执行安装:sh /mnt/cdrom/VBoxLinuxAdditions.run。
猜你喜欢
- 2024-10-15 精品博文为Miz702制作ramdisk文件系统(上)
- 2024-10-15 华硕DSL-N17U路由器新固件:版本1.1.2.2.34
- 2024-10-15 现在能直接在iPhone控制中心开启SSH了,安全,方便!
- 2024-10-15 “Commando Cat” 加密劫持活动利用远程 Docker API 服务器
- 2024-10-15 iOS 11~11.1.2 越狱工具 Electra 更新:终于支持 Cydia
- 2024-10-15 10.3.X越狱完美解决权限问题(越狱时提示越狱工具不能打开)
- 2024-10-15 【电子数据取证】从SSH开始使用Linux
- 2024-10-15 助力影视圈:澳州歌星Dan Sultan用3D打印制作MV视效
- 2024-10-15 在Bleichenbacher '06 十年后 RSA签名伪造攻击仍然有效
- 2024-10-15 英文有声绘本《Bear's Big Ideas》
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)