Tuesday, 23 August 2016

Simple CentOS 7 VM configuration

This setup allows you to ssh into your VM easily (without port forwarding)

  1. Create a new VirtualBox VM with name vm-name of type Linux, Version Linux 2.6 / 3.xd /4.x (64-bit)
  2. Start the VM, select the install iso, follow dialog boxes to complete installation then shutdown the vm
  3. run these commands on the host
    VBoxManage modifyvm "vm-name" --nictype1 82543GC
    VBoxManage modifyvm "vm-name" --nic2 hostonly
    VBoxManage modifyvm "vm-name" --nictype2 82543GC
    VBoxManage modifyvm "vm-name" --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter"
    
  4. run these command on the guest
    sed -ie "s/ONBOOT=no/ONBOOT=yes/" /etc/sysconfig/network-scripts/ifcfg-enp0s3
    sed -ie "s/ONBOOT=no/ONBOOT=yes/" /etc/sysconfig/network-scripts/ifcfg-enp0s8
    systemctl stop NetworkManager.service
    systemctl start NetworkManager.service
    

No comments:

Post a Comment