It is currently Mon Apr 23, 2018 7:26 pm


All times are UTC




Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Bugs GNS3 0.8.2
PostPosted: Sat May 26, 2012 10:13 am 
Offline

Joined: Mon Sep 19, 2011 6:19 am
Posts: 192
Location: Australia
Jeremy, please pay attention to some visual improvements in the new release please :)



_________________
ImageImageImageImage


Top
 Profile  
 
 Post subject: Re: Bugs GNS3 0.8.2
PostPosted: Sat May 26, 2012 10:42 am 
Offline

Joined: Sat Feb 12, 2011 9:16 am
Posts: 87
tranzitwww wrote:
* Related to the multiple VMs for VBox
Nice done, but not finished! :)
Ex: I have 2 VMs. If I add the first one into the topology is permitted and is ok, if I'm doing it again is showing the deny message and is also ok!
But...., I'm creasy enough to test it like this:
Add first Vm, then the second Vm, then the first VM again and so on :)))))
This is allowed now and shouldn't be!
It would be great if the menu to select the virtual machine to a "VBOX-Host" only shows the virtual machines that are not already in the laboratory.

_________________
Live Raizo / Live Linux to simulate networks and performing system administration experiments.
* Last Release : v5.14.09.02p
[ http://sourceforge.net/projects/live-raizo ]


Top
 Profile  
 
 Post subject: Re: Bugs GNS3 0.8.2
PostPosted: Sat May 26, 2012 10:56 am 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
Hi,

grossmj wrote:
I ran your code and it works great. I made some changes to make the integration in GNS3 easier. Here is what I have for now:

I know that this is just a example, but is not a good idea to let it loop for 10 seconds without a sleep, because CPU is going to 100% (one core)
And the thread should be killed when the capture is stopped ("wireshark is closed by user" event is managed by the thread)

Raizo62 wrote:
It would be great if the menu to select the virtual machine to a "VBOX-Host" only shows the virtual machines that are not already in the laboratory.

That bug is history now (last pre-release), but you receive a error message saying: already used :)
Anyway your idea is better! Thanks :D

-------------------[EDIT]------------------
* Some dynamips error
DEBUG (1): sending to dynamips at 127.0.0.1:7200 -> vm set_tsg R1 0
DEBUG (1): returned -> ["202-Unknown command 'set_tsg'"]

* When a router is started/restarted you can do this to fix the console (push a enter on the socket) long before the user is deciding to open putty/etc...
When all routers are started at once is required a loop for each of them :)
Code:
import socket, time, re

def fix_dynamips_console(dynamips_host, console_tcp_port):
   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   s.connect((dynamips_host, console_tcp_port))

   while not re.search('Connected to Dynamips', s.recv(1024)):
      time.sleep(0.1)

   s.send('\r')
   s.close()

fix_dynamips_console('127.0.0.1', 2002)



*Pipes for vbox
Code:
import os, random, subprocess, re

def configure_vbox_vm_pipe(vbox_vm_name):
   com1_pipe=r"\\.\pipe\vbox\name%d" % random.randint(0, 999999)
   vbox_path=os.getenv("VBOX_INSTALL_PATH")

   p = subprocess.Popen(r'"%sVBoxManage" modifyvm "%s" --uart1 0x3F8 4 --uartmode1 server %s' % (vbox_path, vbox_vm_name, com1_pipe), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
   for line in p.stdout.readlines():
      if re.search('Could not find a registered machine named|is already locked for a session', line):
         print "Process Error: %s" % line
         return

def get_vbox_vm_pipe(vbox_vm_name):
   vbox_path=os.getenv("VBOX_INSTALL_PATH")

   p = subprocess.Popen(r'"%sVBoxManage" showvminfo "%s"' % (vbox_path, vbox_vm_name), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
   for line in p.stdout.readlines():
      if "Could not find a registered machine named" in line:
         print "Process Error: %s" % line
         return
      elif re.search('^State: ', line):
         if "powered off" in line:
            vm_state = "off"
         else:
            vm_state = "on"
      elif re.search('UART 1.* attached to pipe', line):
         return line.split("'")[1], vm_state

vbox_vm_name='Linux Microcore 3.8.2'

#configure a pipe
configure_vbox_vm_pipe(vbox_vm_name)

#get the pipe and the vm state
vm_info = get_vbox_vm_pipe(vbox_vm_name)

#if is on start the console
if vm_info[1]=="on":
   subprocess.Popen(r'PUTTY -serial "%s" -wt "%s" -sr' % (vm_info[0], vbox_vm_name))
else:
   print "VM name:\t%s\nVM state:\t%s\nVM pipe:\t%s\n" % (vbox_vm_name, vm_info[0], vm_info[1])



Top
 Profile  
 
 Post subject: Re: Bugs GNS3 0.8.2
PostPosted: Sun May 27, 2012 3:03 am 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Hi Khaled,

Quote:
Jeremy, please pay attention to some visual improvements in the new release please :)


These enhancements need some work, I've added them to our TODO list. Unfortunately you won't see them included in the very next release.

Cheers,

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: Bugs GNS3 0.8.2
PostPosted: Sun May 27, 2012 9:03 am 
Offline

Joined: Sat Feb 12, 2011 9:16 am
Posts: 87
tranzitwww wrote:
* HAHAHAHAHAHa I've got something HUGE!!!!!!!!! (Sorry but I can't keep myself )
Console for VirtualBox :)))))))))))))))))))))))))))))))))
Linux guys will love it! (me too)


Tested on windows!
http://www.buildroid.org/blog/?page_id=38
for Linux check
http://lgallardo.com/en/2010/11/26/usan ... irtualbox/
http://technostuff.blogspot.com/2008/10 ... albox.html
http://automatthias.wordpress.com/2008/ ... irtualbox/
Code:
Configure the serial port of the VM (in VirtualBox VM parameter) this way :
    Port number: COM1
    Port mode: Host Pipe
    Create the pipe : Yes
    Path : \\.\pipe\vbox_whatever1
    Start the VM...

Start your Putty
    Create a connection with the following parameters : type=Serial, Serial line=\\.\pipe\vbox_whatever1, Speed=9600 (speed depends on what is set in the device)
    Open the connection
    putty -serial \\.\pipe\vbox_whatever1 -sercfg 9600,8,n,1,X
    putty -serial \\.\pipe\vbox_whatever1 -sercfg 9600
    putty -serial \\.\pipe\vbox_whatever1

PS: I think this also works in VMware....
Maybe I did not understand everything. I have tried onto Raizo (Host and Guest with Linux debian). To connect to VB-Guest from host using the serial port, i had to modify /etc/initab of guest (http://www.debuntu.org/how-to-set-up-a- ... -on-debian).
I have used socat because the "putty" of Debian doesn't works for that, but the completion of Linux with socat doesnt work. I have not searched much.

edit: completion works better with this command : socat UNIX-CONNECT /tmp/vbox STDIO,raw,echo=0



_________________
Live Raizo / Live Linux to simulate networks and performing system administration experiments.
* Last Release : v5.14.09.02p
[ http://sourceforge.net/projects/live-raizo ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO