》》。下载window下的tap驱动
下载tap-window6(https://github.com/OpenVPN/tap-windows6/releases/download/9.26.0/dist.win7.zip)
》》。下载树莓派2b的img镜像
树莓派(raspberry pi)学习9: Qemu虚拟机联网(主机和虚拟机互访、虚拟机可上网)_qemu 如何使局域网中的机器能够访问虚拟机-CSDN博客 https://blog.csdn.net/c80486/article/details/8460755
Index of /raspberry-pi-os-images/raspbian/images/2012-08-16-wheezy-raspbian/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror https://mirror.tuna.tsinghua.edu.cn/raspberry-pi-os-images/raspbian/images/2012-08-16-wheezy-raspbian/?C=N&O=DIndex of raspberry-pi-os-images/ - SJTUG Mirror Index https://mirror.sjtu.edu.cn/raspberry-pi-os-images/使用QEMU模拟树莓派Raspberry Pi-腾讯云开发者社区-腾讯云 https://cloud.tencent.cn/developer/article/1685107
GitHub - dhruvvyas90/qemu-rpi-kernel: Qemu kernel for emulating Rpi on QEMU https://github.com/dhruvvyas90/qemu-rpi-kernel
》》。扩展img镜像
F:\qemu\qemu-img resize F:\qemu\pi2b\2020-02-13-raspbian-buster-lite.img 64G
》》。启动树莓派2b
okok!!!无网络可以正常启动
F:\qemu\qemu-system-arm -M raspi2b -kernel F:\qemu\pi2b\kernel7.img -sd F:\qemu\pi2b\2020-02-13-raspbian-buster-lite.img -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootwait" -dtb F:\qemu\pi2b\bcm2710-rpi-2-b.dtb -nographic
test!!!okok可以连接网络,但是主机我不知道怎么ssh连接到内部ip
F:\qemu\qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -kernel F:\qemu\qemu_pi2\qemu-rpi-kernel-master\kernel-qemu-4.19.50-buster -hda F:\qemu\pi2b\2020-02-13-raspbian-buster-lite.img -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/sda2 rootwait" -dtb F:\qemu\qemu_pi2\qemu-rpi-kernel-master\versatile-pb-buster.dtb -nographic -netdev user,id=unet -device virtio-net-pci,netdev=unet
!!!!okok可以和主机通讯
F:\qemu\qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -kernel F:\qemu\qemu_pi2\qemu-rpi-kernel-master\kernel-qemu-4.19.50-buster -hda F:\qemu\pi2b\2020-02-13-raspbian-buster-lite.img -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/sda2 rootwait" -dtb F:\qemu\qemu_pi2\qemu-rpi-kernel-master\versatile-pb-buster.dtb -nographic -net nic -net tap,ifname=tap0
》》。扩展空间和安装openssh-server
安装远程
apt install openssh-server
sudo systemctl enable ssh
service ssh restart
netstat -ant
扩展空间
fdisk /dev/sda
删除2,新增2(这里注意删除2之后看看1的结尾扇区号,然后扇区号+1就是分区2的起始点),保存,重启
reboot
磁盘更新 resize2fs /dev/sda2
上面扩展方法好像要取消挂载才行,可以使用windows下dg软件加载img文件扩展未使用的到sda2
18:13 2024/7/14
linux更改密码报错
passwd: Authentication token manipulation error
[root@localhost ~]# lsattr /etc/passwd
----i--------e- /etc/passwd
[root@localhost ~]# lsattr /etc/shadow
----i--------e- /etc/shadow
[root@localhost ~]# chattr -i /etc/passwd
[root@localhost ~]# chattr -i /etc/shadow
[root@localhost ~]# lsattr /etc/shadow
-------------e- /etc/shadow
[root@localhost ~]# lsattr /etc/passwd
-------------e- /etc/passwd
[root@localhost ~]#