How to use Putty to connect to a virtual machine? - putty

I am running a virtual machine on Virtual Box
On running ifconfig eth1, I get
inet addr: 192.168.56.11 and many more values.
How do I use Putty (ssh) here?
I entered 192.168.56.11 on the Host Name and 80 on the Port Number, but Putty can't connect.
I am trying to follow the guidelines from this course:
https://s3-us-west-2.amazonaws.com/cs144-misc/instructions/vm.html
What exactly does Putty do? I don't understand why I need to do this.

PuTTY will open a "network" between both machines. You'll get a console (like the shell) when you'll be connected. Really useful to administrate remote server from your computer.
Usually, the port is not 80, but 22.

For oracle vm virtual box:
1)Power of your machine
2)goto Settings -> Network -> Adapter1 -> Enable Network Adapter -> select "Bridge Adapter" in Attache To tab and click 'ok" button
3) open terminal in virtual box and type" ifconfig"
in first paragraph
eth0 Link encap:Ethernet HWaddr 08:00:27:fb:d1:28
inet addr:172.16.2.199
4) Here ip address is "172.16.2.199" using this ip and port 22 ,you can login through putty and winscp also

Try opening terminal through VMWare's console on Ubuntu and then run below given code:
sudo apt-get install openssh-server

I had faced the same issue.
Note: I assume you have already started the VM, importing the ISO image, and tried to access the machine with 10.X.X.X or 172.X.X.X range IP address from the Putty agent and got an time-out message.
Before making any changes to the network configuration on the VM or trying bridge-adapters, as suggested by many of the articles online, I suggest you to check 2 robust points which forms the bus for your VM on VirtualBox and Putty agent installed on your system.
1st Point:
Opening Host Network Manager in File section of your Oracle VirtualBox
Adding a host-only ethernet network (I suggest to keep a 192.X.X.X range)
2nd Point: Adding a host-only adapter, under the network settings of your VM.
Host-Only Adapter settings
If you follow these steps before booting up the VM for the first time, your VM will be allocated with a 192 range IP address (by the dhcp) the moment it boots up and starts running. Now all you need to do is, install and openssh-server and use the 192-range IP address with the Putty agent and Voila!!
Hope this help! Greetings!

Related

How do I access an Oracle VM in my local network from another device?

I have following setup:
Windows 10 desktop with VirtualBox Oracle VM running
MacBook M1 which needs access to the Oracle VM
Windows desktop and MacBook are on the same local network
From my MacBook i'm able to ping my windows desktop's IP, but not the IP of the VirtualBox VM.
On the Oracle VM's settings I have a bridget adapter configured.
Is there a way to connect from my MacBook to the Oracle VM hosted on my Windows desktop in the same network?
Thanks in advance!
It depends on what type of network adapter you defined to the VM. In order to access from other machines on your LAN, you will need a BRIDGED adapter. Further, you will need to configure it (in the guest OS) with a manually assigned IP address in the same subnet as your other machines. My guess is you just took defaults and have only a NAT adapter.
I've built scores of VM's under VBox, and always create two adapters. The first is a NAT adapter, which allows my vm to access the internet - critical for downloading and installing packages with 'yum'. The second adapter is either HOSTONLY or BRIDGED. I use HOSTONLY if I want the VM to be totally isolated from the LAN and only accessible by the host or other vm's on the host. I used BRIDGED if I want to access the vm from other machines on the LAN. Either way, the BRIDGED or HOSTONLY need to be configured with a manually assigned ipv4 address in the same subnet as the host os.
I always create the NAT as the first adapter, and the BRIDGED or HOSTONLY as the second. On the os, the first (NAT) shows up as 'enps03' and the second as 'enps08'. I then configure enps08 with the following:
First, run the command below to set up the IP address. (substitute your chosen IP, but keep the '/24')
$ nmcli con mod enp0s8 ipv4.addresses 192.168.0.200/24
Next, configure the default gateway as shown - again, the first three octets of your subnet.
$ nmcli con mod enp0s8 ipv4.gateway 192.168.0.1
Next , set the addressing to static.
$ nmcli con mod enp0s8 ipv4.method manual
Set to start on boot
$ nmcli con mod enp0s8 connection.autoconnect yes
To save the changes, run the command
$ nmcli con up enp0s8
Reboot and check with ‘ifconfig’.

Why can't I connect to 127.0.0.1 HortonWorks Dashboard?

I have installed Virtual Box (Version 5.2.0 r118431 (Qt5.6.2)) on Windows 10 and i imported appliance HDP_2.4_virtualbox_v3 (downloaded from here).
I followed the tutorial from here step by step.
The virtual machine is running on the computer from where I am trying to access the Dashboard. I have set up the Host Only Adapter Option on the sandbox so the computer and the virtual machine can communicate
After the CentOs finished booting I am prompt to enter to the ip 127.0.0.1:8888, which is a different address from the tutorial,
and there is no server listening to that address because i get
"127.0.0.1 refused to connect." in the browser.
image here
Run the ipconfig command in your command prompt and identyfy your virtual box's ip under Ethernet adapter VirtualBox Host-Only Network.
Take that ip address and go to your Virtual Box.
Select your appliance and go to Settings->Network->Adapter 1->Port Forwarding.
Replace the Host IP 127.0.0.1 for the port you need 8080, 8888 and so on with the ip of your virtual box that should be sth like 192.168.x.x.
Now start your sandbox, login on it and try to connect in your browser to the new ip set 192.168.x.x:8888.
Use appliance HDP_2.4_virtualbox because in the most recent some linux commands like netstat are considered deprecated and no longer function, which willmake your life harder when trying to debug or identify a networking problem.
If you still encounter issues eith it, reinstall your operating system, reinstall your virtual box and reimport the sandbox, make the changes needed in the Port Forwarding settings and it should be ok.
try to connect using 127.0.0.1 to connect make sure the VM is running make sure there are no errors if there are debug them and at the last straw uninstall the Vm and retry (make sure to make a backup if there are any files)
you can also try to check all the local host ips on your network and try to connect to them
Make sure you set NAT in your VirtualBox network settings:

Connection timeout error for winscp to cloudera vm

I am trying to connect Cloudera VM from my Windows desktop using Winscp for file transfer.
But I am not able to connect it using winscp. It is showing me connection timeout error.
Anybody has any idea how to solve this issue.
Thanks,
Atul
I figure out, bow to do it. The error was I am referring wrong IP address. To know right IP address and connect follow below steps.
First, if the Cloudera VM is running then shutdown it.
Second, go to setting. refer below screenshots
Then start the Cloudera VM again.
Go to terminal.
Type the command ifconfig.
On Consol you will find eth1 - where you have to look for ipnet, next to it is your IP address, which you have to use to connect to VM. note down the address.
Go to windows.
Open Winscp.
Create New Site.
Put the host name as the IP address which we got from consol
Username- cloudera, password- cloudera
Port-22
Click on Save.
Click on login.
Hope this will help.
Thanks,
Atul
I can connect to cloudera VM 5.15 from winSCP from my laptop(windows).
I am using Virtual box.
I have downloaded VM from cloudera official site and then choose option file-import appliance ,it will choose by default Network adapter NAT and then I followed as mentioned below.
add cloudera.quickstart in hosts file
C:\Windows\System32\drivers\etc\hosts
localhost name resolution is handled within DNS itself.
127.0.0.1 localhost quickstart.cloudera
Recommended VirtualBox Configurations
Right click on the VirtualMachine and click Settings
Setup the VM to allow you to copy and paste from that machine to your local and vice-teversa
Click on General -> Advanced
Set Shared Clipboard to Bidirectional
Setup port forwarding from port 2222 to port 22 to allow SSH to the machine
Click on Network -> Advanced -> Port Forwarding
Add a new entry
Name: 2222
Host Port: 2222
Guest Port: 22
Accessing the VM
SSH’ing to the Machine
Default SSH Credentials: cloudera/cloudera
Host to connect to: localhost
Because of the Recommended VirtualBox Configuration above, we’re forwarding connections from port 2222 to 22. So you would want to use port 2222 to connect.
Windows
Open putty/winscp
Use ip as 127.0.0.1
Set 2222 as the port
Connection Type: SSH
Click open
Enter the password

Access Docker container running on OS X via boot2docker in Windows virtual machine

Overview:
Host: Mac OS X running boot2docker and Docker
Guest: Windows 7
The Problem:
For my web-development I have set up a docker container via boot2docker on OS X. Within OS X I can access my docker services via boot2docker.
Running boot2docker ip, I get:
The VM's Host only interface IP address is: 192.168.59.103
I am running a Django application on port 1234 (I have mapped the port 5000 on the docker image to port 1234 on my Mac) which I can access within OS X in an web-browser via the address 192.168.59.103:1234. Everything works fine in OS X.
Now I have to test the Web stuff on IE which is why I have downloaded IE8, IE10 and so forth via Microsofts modern.IE website. As a result I have some more VirtualBox images, which are running Windows 7 and come with the propriate IE version.
The question is now how to access the Docker container in those Windows instances to test it under several IE versions.
What I have done so far:
Idea 1
To access the Django application I have looked up my local IP address and tried to access it via NAT in the Windows guests. Given my local IP adress 192.168.178.24, I have tried to access 192.168.178.24:1234 from Windows. Although I can ping 192.168.178.24 from Windows, I do get only a timeout on the port 1234.
Idea 2
Boot2docker runs a VirtualBox machine called boot2docker-vm. It comes with two network adapters, NAT and a host-only adapter called vboxnet0. The latter has the address 192.168.59.3 (which is the one which boot2docker ip returns) with the network mask 255.255.255.0. It runs a DHCP-Server on Server Adress 192.168.59.99 which gives addresses from 192.168.59.103-254.
I have added a second network adapter for my Windows guest systems which can also access via a host-only adapter the network vboxnet0. When being connected to the network the Windows machines do get a valid IP and can ping the IP 192.168.59.103. But I cannot connect to my Django instance on port 1234. If I try to call 192.168.59.103:1234 within Windows, I get a timeout.
Why is it not possible to connect to the Django instance? Can you help me? Thanks in advance.
I have found a solution to my problem here.
To get access to the Django instance I had to open the port on the boot2docker-vm machine.
This can be done by either by boot2docker-vm → settings → Network → Adapter 1 (NAT) → Port Forwarding and add a new rule where Host IPand Guest IP can be left empty and Host Port and Guest Port should be set to 1234.
Another way to do so is executing the following command in the command line
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port1234,tcp,,1234,,1234";
Of course this needs to be done for all ports, if more than one port is being used.

Using gitlab-vagrant-vm from OSX host

I followed the instructions here and was able to succesfully (I think) install the gitlab vagrant virtual machine on OSX 10.8 using virtualbox.
I can do vagrant up to get the VM running, and everything seems to work fine. After that I can do vagrant ssh without a problem. Also, after sshing into the VM I was able to do bundle exec rake gitlab:test, which completed with results being 1584 examples, 0 failures.
I would like to see the gitlab web interface from my OSX host machine. I thought I could just direct my browser to the IP indicated in the VagrantFile (http://192.168.3.14), but that didn't work.
Any ideas?
Also any other usage tips for this setup would be appriciated (things like where the repositories are stored on my host machine so I can back them up, if anyone set the gitlab-vagrant-vm up for external access from either another computer on the network or a remote source, ect.)
You have to connect a second interface for vagrant. To do this you've to edit the VagrantFile.
For example if you want to conenct to the host wifi add the following line after 192.168.3.14
config.vm.network :bridged, bridge: "en0: Wi-Fi (AirPort)"
You also can bridge to the ethernet interface. Use ifconfig on the host machine to determine the right interface. After that the dyndns-server of the host network will assign an IP to the Vagrant-Box. Then you can access GitLab on that IP.
Did you actually start the server? You can do that with
bundle exec foreman start -p 3000
This will start the server on port 3000, you would then access it from the host with
http://192.168.3.14:3000/
Hope this helps,
Chris

Resources