zoukankan      html  css  js  c++  java
  • qemu vm setup network(ssh) with buildroot

    1, build buildroot with buildroot.config, that is 'make qemu_x86_64_defconfig' + some packages, sshd, etc.
    git://git.buildroot.net/buildroot

    2, build kernel with alios-kvm.config, which is alios7 4.9 config + 'make kvmconfig' + 'make localyesconfig'

    3, setup remap tcp port 22 to 2222, in qemu boot command, '-redir tcp:2222::22'
    qemu-system-x86_64 --kernel ~/sdb/kernel-4.9/arch/x86_64/boot/bzImage
    -hda ~/sdb/kernel-4.9/rootfs.ext2 -m 128G
    -net nic,model=virtio -net user -redir tcp:2222::22
    -append 'root=/dev/sda console=ttyS0 ' --nographic -enable-kvm

    4, setup sshd in rootfs.ext2, add 'PermitRootLogin yes' in /etc/ssh/sshd_config

    5, booted guest and setup ssh nokey from host to this guest
    a, ssh-keygen
    b, ssh-copy-id -i ~/.ssh/your_key.pub root@localhost -p 2222

    6, enjoy! ssh -p 2222 root@localhost

  • 相关阅读:
    最小生成树算法
    并查集
    背包问题
    木桶排序
    STL之vector
    STL中的queue用法与stack用法对比
    快速幂求模
    归并排序+典型例题(逆序对)
    负进制转换
    冒泡排序
  • 原文地址:https://www.cnblogs.com/muahao/p/9075327.html
Copyright © 2011-2022 走看看