Connect to junos on VirtualBox (using netconf protocol) - ssh

I have done everything like in this article. There is an account (with super-user privileges), password, set netconf ssh and set ssh commands issued along with an ip address (for em0 192.168.56.150/24). My host OS (windows 8.1) for Ethernet adapter VirtualBox Host-Only Network has 192.168.56.101. I have downloaded and "ready to run" Netconf java toolkit (by juniper group). How can I connect to junos instance from java toolkit ? (how to set adressess between host os and juniper os running inside virtualbox)

On junos box:
config# set system services netconf ssh
config# commit
Use the below link to create simple java program on host and the program:
Link
Device device = new Device("junos-box-ip-address", "username-junos", "password-junos", null);

Related

Why can not conntect to the IP provided by my WSL console when i trying to use static-server for testing on mobile

I am using NODE and npm static-server to display my .html files on the local network.
I have no problems when I use Git Bash to deploy static-server. I was able to access from my mobile device using the ip that I got with ipconfig (the option LAN adapter Wi-Fi).
The problem is when I try to do the same process but from my WSL Terminal (Windows Subsystem for Linux).
The IP obtained with the ip address command allows me to access it from my own computer, but I cannot access it from my mobile device.
In the Git Bash environment the command ipconfig shows me several IPs including the Wi-Fi LAN adapter, and using it I was able to connect effectively. But in the WSL environment I only get one IP, and it does not work to access from my mobile through the Wi-Fi network, I just can access to it from the computer.
Does the NODE version have something to do with it? or should i use a different command in the WSL environment to obtain Wi-Fi LAN adapter IP? In this case, which command? Thanks
Commparative image Basch vs WSL and NODE version

How could I access my VM in my host machine (By different IP)?

I want to access the virtual machine IP in the host (by ping or curl or something), but it is not ok. How could I make it?
The host machine is a win10 PC.
A virtual machine using VMware workstation 15, Ubuntu 16.04 server. It has IP address 192.168.178.138 and 10.0.0.11. I can access the 192.168.178.138, but cannot access 10.0.0.11. (no matter ping or curl...)
All are NAT mode in VMware Workstation.
Now I have a web application running on 10.0.0.11:80. How could I access it in my host machine.
Btw I have another VM with 192.168.178.39 and 10.0.0.31, and this VM can access the 10.0.0.11:80 by curl.
I can show the topo as below.
(A little Chinese but it won't affect reading, just ignore it)
Yes, now I solve this question by myself.
It seems that you cannot use the Host-only mode (Actually I can only use this mode...).
You need to set the virtual interface in your host PC (The IP, gateway, or anything else...);
Then you need to set in the VMWare workstation, set it to use speical lan (VM net 2 for me);
Then you can access it from the host machine and other vm, maybe you need to search something like NAT translation in VMWare workstation to access your web application deployed in the VM from outer network.
That's what I do, now I can access my horizon dashboard in the browser (The Ubuntu server don't have any browser... T-T sad ...)
Settings Picture

Windows 10 update then can't connect to guest vm

I'm a beginner in vm, I always used a working vm :D but today I've a big problem... :?
I've just updated my system windows 10 with the new available and suggested update, but now I can't connect to my guest vm.
Before (after windows update) I runned virtualbox 5.1.14 and it doesn't work, now I installed virtualbox 5.1.30 with the same result.
Before window's update it worked.
Initially I had one problem, host-only network doesn't works and the vm didn't start, so I deleted the old host-only network and created a new one and now the vm start, but I can't connect to the machine, that has a static ip (192. 168. 109. 151), with putty via ssh port 22, and also via http.
I used this ip address to connect to vm via browser.
The vm can ping google, and in virtualbox command line I can log in and make everything.
Some one know why I can't connect with my vm?
In virtualbox preferences I have set host-only network with this values:
IPV5 address 219.168.56.1
DHCP: 192.168.56.102
mask: 255.255.255.0
lower: 192.168.56.103
upper: 192.168.56.254
ok, now I can access via putty to port 22. I needed to add the static ip of the vm to virtualbox host-only network net in windows control panel, to tcp/ip protocol.
Now I need to acces via browser. For the moment it doesn't works

Cannot do Vagrant ssh after Vagrant up on windows Machine

I am building a sample vagrant box to install Jenkins and push it to atlas cloud.Please find below the steps that I followed.
Vagrant init ubuntu/trusty64
and the normal command to initialize the vagrant machine.
vagrant up
After this if i type command to ssh into the machine
vagrant ssh
It gives me error saying please increase timeout and so.
The main question is how can I ssh into the newly created vagrant machine.
To understand this, I have to go through all the basics. Please find below my findings.
Not attached
In this mode, VirtualBox reports to the guest that a network card is present, but that there is no connection -- as if no
Ethernet cable was plugged into the card. This way it is possible to "pull" the virtual Ethernet cable and disrupt the connection, which can be useful to inform a guest operating system that no network connection is available and enforce a reconfiguration.
Network Address Translation (NAT)
If all you want is to browse the Web, download files and view e-mail inside the guest, then this
default mode should be sufficient for you, and you can safely skip the rest of this section. Please note that there are certain limitations when using Windows file sharing (see Section 6.3.3, “NAT limitations” for details).
NAT Network
The NAT network is a new NAT flavour introduced in VirtualBox latest versions.
Bridged networking
This is for more advanced networking needs such as network simulations and running servers
in a guest. When enabled, VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system's network stack.
Internal networking
This can be used to create a different kind of software-based network which is visible to selected virtual machines, but not to applications running on the host or to the outside world.
Host-only networking
This can be used to create a network containing the host and a set of virtual machines, without the need for the host's physical network interface. Instead, a virtual network interface (similar to a loopback interface) is created on the host, providing connectivity among virtual machines and the host.
Generic networking
Rarely used modes share the same generic network interface, by allowing the user to select a driver which can be included with VirtualBox or be distributed in an extension pack.
At the moment there are potentially two available sub-modes:
UDP Tunnel
This can be used to interconnect virtual machines running on different hosts directly, easily and transparently, over existing network infrastructure.
VDE (Virtual Distributed Ethernet) networking
This option can be used to connect to a Virtual Distributed Ethernet switch on a Linux or a FreeBSD host. At the moment this needs compiling VirtualBox from sources, as the Oracle packages do not include it.
Out of these, only NAT and Host-only network is important.So, to solve this issue, I modified the predefined Vagrant file with the following code.
jenkins.vm.provider "virtualbox" do |vb|
jenkins.vm.network "private_network",ip:'192.168.56.5',:adapter => 2
jenkins.vm.hostname = 'jenkins.ci'
vb.name = "Jenkins"
end
Here, I have created a private network with static Ip and also, I specified the adapters count to use 2. The Private adapter is Host-only adapter and 1st adapter which is default one is NAT.

Accessing VM's terminal using putty in host OS?

I am working on a project in which we logon to client's machine using Cirtix receiver. The machine which we connect to using Citrix receiver is basically a Windows 7 machine. Once we are in the client's windows box, inside that we have virtual box, in which VM has been added and which has all the needed software for us to do the development; for example JBOSS, database etc.
In the host machine (windows 7), we have putty, and using putty we sometimes login to the VM (i.e. terminal). The confusion which I have is as below:
We login to the VM terminal using IP address: 127.0.0.1. This is where my confusion is. 127.0.0.1 normally is the IP address with which we can refer to the current machine; so how using this IP address we are able to connect to the VM which is added to the virtual box? Doesn't the VM which is in virtualbox has its own IP address with which we can connect to? Or is there some concept which I am not aware of.
Can anyone help me in understanding this? I am not well versed with virtualization, so for the gurus this might be a naive question.
Every VM will have their uuids so to access the VM inside virtualBox or any hypervisor for that matter. so you can use that particular VM uuid and u should be able to console to that VM.
in virtual box try below
You can use: VBoxManage list vms to list all currently registered VMs with their settings, names and UUIDs.
Once you know the UUID you can also start a vm by:
VBoxManage startvm which is essentially same as: VBoxManage startvm "Name-of-vm"
Also Vm has two interfaces one loopback which will have an address of 127.0.0.1 and the rest of the interfaces so to access the VM with particular ip you need to assign an IP to that VM interface and than try with that IP.Also you might have that port 22 open for that loopback ip so may be that is the reason you are able to connect on loopback
I hope this answers your question