I have had some tasks to configure and install a CentOS distribution for my bug-tracking needs. Hope to help out someone with similar problems and or tasks.
I'll be using a fresh install of a CentOS Minimal 6.5. And a Mac Book Pro with VirtualBox installed (as my testing environment).
First after install of a clean CentOS you need an SSH server to work in your usual environment. So to connect to a Linux, installed in a VirtualBox you will need basically 2 things:
And start and add it to auto launch at system startup:
Also make sure port 22 is opened in your VM. type:
To disable firewall and remove from auto lunch at system startup run:
I'll stop on a simple one. You may do a Bridged network connection and have your router/whatever assign your VM an IP address inside your network.
You may also select NAT and configure port mappings. But it's fairly more complex rather then this setting and exceeds the scope of this article.
Mine got an IP ending with 104.
And so now you can ssh connect to your VM terminal using something like:
Tadaa! Your system is up and ready for experiments. Just be sure to save your state with VM snapshots ;)
Comments?
I'll be using a fresh install of a CentOS Minimal 6.5. And a Mac Book Pro with VirtualBox installed (as my testing environment).
First after install of a clean CentOS you need an SSH server to work in your usual environment. So to connect to a Linux, installed in a VirtualBox you will need basically 2 things:
- openssh-server install
- disable firewall
- VirtualBox Port configuration/Access configuration
OpenSSH server install
To install server you need to run in your VirtualBox Guest system (CentOS VM):yum -y install openssh-server
chkconfig sshd on service sshd start
netstat -tulpn | grep :22
Firewall settings
Because it's a VM you can simply disable the firewall. But be sure not to do this at deployment/production server of any kind.To disable firewall and remove from auto lunch at system startup run:
service iptables stop chkconfig iptables off
VirtualBOX
To connect your Guest machine to your Host machine (basically up a network between virtual CentOS and your host Mac OS (In my case) you have several options.I'll stop on a simple one. You may do a Bridged network connection and have your router/whatever assign your VM an IP address inside your network.
You may also select NAT and configure port mappings. But it's fairly more complex rather then this setting and exceeds the scope of this article.
Connect
Now you need to reboot your CentOS or either reboot network inside your VM. As a result, after reboot you should get assigned IP address. You can view it using command:$ ifconfig eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX inet addr:192.168.1.104 Bcast:192.168.1.255 Mask:255.255.255.0
And so now you can ssh connect to your VM terminal using something like:
$ ssh root@192.168.1.104 root@192.168.1.104's password: Last login: ... [root@localhost ~]#
Comments?
This comment has been removed by a blog administrator.
ReplyDeleteThanks a lot, works like a charm :)
ReplyDeleteThank you, it is very useful!
ReplyDelete