win10_x64(vmware) --> ubuntu(qume)–> kylin_arm64
一、windows下安装vmware虚拟机
二、ubuntu下载地址
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04/ubuntu-20.04.3-live-server-amd64.iso
三、vmware中新建虚拟机,并使用ubuntu-20.04.3-live-server-amd64.iso作为启用盘
。。。在虚拟机中安装ubuntu(略)
四、配置ssh(如果ssh登录不上时配置)
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
systemctl restart sshd
五、配置虚拟机的网络为br0
cat > /etc/netplan/01-network-manager-all.yaml << 'EOF'
network:
version: 2
renderer: networkd
ethernets:
ens32:
dhcp4: no
dhcp6: no
bridges:
br0:
addresses: [192.168.11.220/24]
dhcp4: no
dhcp6: no
gateway4: 192.168.11.2
nameservers:
addresses: [192.168.11.2,223.5.5.5]
interfaces:
- ens32
EOF
重启网络
netplan apply
六、在虚拟机中安装qemu
apt-get update -y
apt install net-tools lrzsz wget unzip -y
apt openssh-server -y
apt install qemu -y
apt-get install qemu-kvm -y
apt install qemu-system-arm -y
apt-get install bridge-utils
七、下载centos7(aarch64) 和UEFI固件
#下载UEFI固件
wget http://releases.linaro.org/components/kernel/uefi-linaro/16.02/release/qemu64/QEMU_EFI.fd
#下载银河麒麟V10
鲲鹏,飞腾版本 下载地址 https://pan.baidu.com/s/1GOLao-6WmGqUkCXf1CA6qg 提取码:1vt8
八、创建centos7(aarch7)虚拟机
把下载好的Kylin-Server-10-SP2-aarch64-Release-Build09-20210524.iso放到/test02目录下
#切换到root下
sudo su -
mkdir /test02
cd /test02
#创建磁盘,此步要注意,可能是bug,直接创建的qcow2,不能在文本模式下安装,会导致“磁盘配置保存失败”
qemu-img create -f qcow2 kylin-arm64.qcow2 40G
#请以下步骤把磁盘改为GPT模式
modprobe nbd max_part=12
qemu-nbd --connect=/dev/nbd0 kylin-arm64.qcow2
cat << END | fdisk /dev/nbd0
g
w
END
qemu-nbd --disconnect /dev/nbd0
cat > start.sh << 'EOF'
#!/bin/bash
#创建桥接网络
#visodu
#szgd ALL=(ALL) NOPASSWD: ALL
sudo ip tuntap add dev tap0 mod tap
sudo brctl addif br0 tap0
sudo ifconfig tap0 0.0.0.0 promisc up
sudo brctl showstp br0
SYSTEMISO=$(ls *.iso)
DISKFILE=$(ls *.qcow2)
qemu-system-aarch64 -m 6144 -cpu cortex-a72 -smp 6 -M virt \
-bios QEMU_EFI.fd \
-nographic \
-drive if=none,file=${DISKFILE},id=hd0 \
-device virtio-blk-device,drive=hd0 \
-device virtio-scsi-device \
-net nic,macaddr=`dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(.\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\14:\2:\3:\4:\5:\6/g'` \
-net tap,ifname=tap0,script=no,downscript=no \
# -drive if=none,file=${SYSTEMISO},id=cdrom,media=cdrom \
# -device scsi-cd,drive=cdrom \
EOF
九、安装银河麒麟V10_飞腾版
docker 镜像
docker pull leechm/kylin:v10-aarch64
/etc/yum.repo.d/kylin.repo
###Kylin Linux Advanced Server 10 - os repo###
[ks10-adv-os]
name = Kylin Linux Advanced Server 10 - Os
baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/base/$basearch/
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
enabled = 1
[ks10-adv-updates]
name = Kylin Linux Advanced Server 10 - Updates
baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/updates/$basearch/
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
enabled = 1
[ks10-adv-addons]
name = Kylin Linux Advanced Server 10 - Addons
baseurl = http://update.cs2c.com.cn:8080/NS/V10/V10SP2/os/adv/lic/addons/$basearch/
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin
enabled = 0