qemu运行Ubuntu 18.04/arm64

之前搭过很多次,这次又忘光光了,花了很久才搞定,遇到的问题是死活登录不进去

主要参考

https://svn.r-project.org/R-dev-web/trunk/Blog/content/post/2020-05-29-qemu-testing.html

dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64

sudo virt-customize -a ubuntu-18.04-server-cloudimg-arm64.img --root-password password:root

qemu-img resize ubuntu-18.04-server-cloudimg-arm64.img +10G

qemu-system-aarch64 -smp 8 -m 8192 -cpu cortex-a57 -M virt -nographic -pflash flash0.img \
  -pflash flash1.img -drive if=none,file=ubuntu-18.04-server-cloudimg-arm64.img,id=hd0 \
  -device virtio-blk-device,drive=hd0 \
  -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22

登陆账号/密码

root/root

修改 /etc/ssh/sshd_config

PasswordAuthentication no

改为

PasswordAuthentication yes

再执行

systemctl restart ssh

root登录后可以随意修改ubuntu账户的密码,host可以通过

ssh -p 5555 ubuntu@localhost

输入密码登录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值