Giter VIP home page Giter VIP logo

Comments (11)

akhiljns avatar akhiljns commented on May 26, 2024 1

@akhiljns

yes, your ananlysis is correct.

I am not sure about defining a static IP address.

but I see ppl facing troubles with bridge network so I opened this issue to record this #33 (may be to use NAT such as vagrant)

Ok so finally I have some time to start looking deeper into this project. Really interesting project that you've built here. I'm going to work on this a lot now.

I have 3 points to mention

  1. So for now Essentially this project is a wrapper on top of virtualbox VBoxManage commands (unless another hypervisor is added), I don't think it is the problem of bridged network, it seems to be the problem of not being able to find the ip address of the created vm, it either spawns many goroutines, spike the goroutine count and results in memory leakage OR maybe its just not finding the ip
    : to solve this maybe we should try assigning an ip address to the created vm since to ssh into the box we need to provide a static ip to the box, let me see if I can assign a static ip using VBoxManage

  2. If we can't provide static ip address then there should be a way to get the ip address of the vm after creating it like maybe VBoxManage import command or startvm command returns ip address which we can use to ssh directly

  3. We should add another hypervisor to really make this project interesting like qemu since it has good support for commandline commands and is very light to be managed by vermin

from vermin.

akhiljns avatar akhiljns commented on May 26, 2024 1

BTW, I had this short conversation with chatgpt where it suggests to use dhcp client to try to discover the ip address, you can find it here

https://chat.openai.com/share/fe7b9f6c-9f91-42e4-bd32-4410596f9485

I'm going to add qemu as the next hypervisor after I figure out this network issue, I'm still keen on using bridged network because that way we can actually truly simulate a cluster since we will get vm<->vm communication and also LAN connection which is essential if I have lets say a database server and a application server in the same cluster. Using NAT with port forwarding would also allow us to do this I think, but i'll give this a try

So, I looked at the chatgpt code but sadly that does not work the dhcp client it uses doesn't have the functions it's using. but I have an interesting workaround

If I provide the same MAC address to the vm then it will get same ip address as the host so maybe we can do this and then ssh into the vm and then provide a static ip address there, this is just a thinking for now, i'm trying this, i'll share my findings

from vermin.

akhiljns avatar akhiljns commented on May 26, 2024

Screenshot 2024-03-20 221508

@mhewedy this function seems to be spawning 65535 goroutines

what exactly are you trying to do here?

ipAddr, err := ip.Find(vmName, false)
	if err != nil {
		return err
	}

	return cmd.Ssh(ipAddr, "-tt").Interact()

seems like this particular code is trying to ping every ip in that subnet and checking which ip address returns a pong (but if I am wrong then please correct me here)

can't we define a constant ip address before starting the vm and assign that ip to inbound connections to that VM?

from vermin.

mhewedy avatar mhewedy commented on May 26, 2024

@akhiljns

yes, your ananlysis is correct.

I am not sure about defining a static IP address.

but I see ppl facing troubles with bridge network so I opened this issue to record this #33 (may be to use NAT such as vagrant)

from vermin.

akhiljns avatar akhiljns commented on May 26, 2024

@mhewedy Alright then I'm going to research about this a bit and then do this myself

from vermin.

mhewedy avatar mhewedy commented on May 26, 2024

@akhiljns
I like your analysis… and I am open to accept solutions to fix the ip addr issue

+1 for adding another hypervisor

from vermin.

mhewedy avatar mhewedy commented on May 26, 2024

BTW, I had this short conversation with chatgpt where it suggests to use dhcp client to try to discover the ip address, you can find it here

https://chat.openai.com/share/fe7b9f6c-9f91-42e4-bd32-4410596f9485

from vermin.

mhewedy avatar mhewedy commented on May 26, 2024

I didn't got this part

If I provide the same MAC address to the vm then it will get same ip address as the host so maybe we can do this and then ssh into the vm and then provide a static ip address there, this is just a thinking for now, i'm trying this, i'll share my findings

I did some quick research for a reliable way to discover IPs in the network, and I see ppl referring to nmap maybe? as ARP (the currently used technique in vermin) returns the cache of usage in case there was a connection between the current machine and the target IP

from vermin.

akhiljns avatar akhiljns commented on May 26, 2024

@mhewedy I actually solved this using GetVmProperty command,

https://forums.virtualbox.org/viewtopic.php?t=38879

I was surprised to know that virtualbox developers themselves didn't know about this, I have a friend in oracle who spoke to the team but they didn't know about this

turns out you can get the ip address of the started vm

raising a pr

PS: by the way

If I provide the same MAC address to the vm then it will get same ip address as the host so maybe we can do this and then ssh into the vm and then provide a static ip address there, this is just a thinking for now, i'm trying this, i'll share my findings

this thing works

from vermin.

mhewedy avatar mhewedy commented on May 26, 2024
  1. We should add another hypervisor to really make this project interesting like qemu since it has good support for commandline commands and is very light to be managed by vermin

I think libvert might be a better option. as it is higher level than qemu and it utilizes qemu and KVM already.

from vermin.

akhiljns avatar akhiljns commented on May 26, 2024
  1. We should add another hypervisor to really make this project interesting like qemu since it has good support for commandline commands and is very light to be managed by vermin

I think libvert might be a better option. as it is higher level than qemu and it utilizes qemu and KVM already.

oh yeah I've heard about libvert but never used it, let me look into it

from vermin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.