Comments (9)
Wow that was fast :-) thx a lot
from packer-plugin-tart.
It may, I'll have to see how it is implemented. My goal is to be able to access things from inside RecoveryOS, so if it can work in RecoveryOS as well as in a fully booted macOS, I'm all for it.
(I'm also investigating implementing the HTTP server, if you think you'd accept a PR for it.)
from packer-plugin-tart.
I made some work-in-progress on serving from http_directory
config in a branch here: https://github.com/timsutton/packer-plugin-tart/tree/http-server
The main thing it's missing is implementing the automatic detection of the host IP. We could start with NAT and take its gateway IP that is set on the bridge100
interface. But ideally it should work with other network config modes as well (and not sure whether softnet would need special handling, since I haven't yet used that networking mode).
There might also be a better/safer way than the above, but I just haven't spent enough time looking at possible options for this. I'll continue experimenting there.
from packer-plugin-tart.
Notes for possibly helping to implement this:
https://github.com/hashicorp/packer-plugin-vsphere/blob/main/builder/vsphere/iso/builder.go#L97
https://github.com/hashicorp/packer-plugin-sdk/blob/main/multistep/commonsteps/step_http_server.go
from packer-plugin-tart.
Will #15 work for you? We were planning to look into it in the coming weeks to simplify installation of Xcode so we don't need to download it every time.
from packer-plugin-tart.
Of course we'll review the PR! And we'll happily accept it. 👌
from packer-plugin-tart.
I'm hoping to find more time this week to continue hacking away at this, but in case others get to it before I do, I was able to get the step_wait_for_ip and step_http_ip_discover steps cloned over and working fairly easily with minimal changes.
In step_wait_for_ip
I added the function
func WaitForIP(vmName string, waitTime string) (string, error) {
return TartExec("ip", "--wait", waitTime, vmName)
}
and replaced this line to use the new function.
In build.go
, I have this hacked together for now for testing
steps = append(steps,
new(stepSetVM),
new(stepDiskFilePrepare),
new(stepRun),
commonsteps.HTTPServerFromHTTPConfig(&b.config.HTTPConfig),
&StepHTTPIPDiscover{
HTTPIP: b.config.BootConfig.HTTPIP,
Network: b.config.WaitIpConfig.GetIPNet(),
},
)
Edit: I just remembered that we mostly only care about the host IP for the HTTP server, so probably only the step_http_ip_discover
stuff is really relevant. Leave the other notes here anyway.
from packer-plugin-tart.
Yeah, we just want to obtain it on the host.
I borrowed the ifconfig
-parsing code from packer-plugin-vmware, and while this worked, it is a step that needs to happen after the VM has started (and return an IP before the boot_command is typed), because only then can we expect to have the bridge100
interface exist. It takes about 6-8 seconds to show up after a VM has been started.
It could be added into stepRun
so that it's insertable within the flow of things that happen in that step, but I wonder if it'd make sense to start breaking up that step into more steps, similar to the vmware builder. I haven't tried that yet so it would increase the scope of a PR somewhat.
I think some other builders have precedents of being able to obtain the host IP before the VM is started, because something like vmware-natd
is already running as a background daemon managing NAT leases for a persistent gateway interface. With these Apple Silicon VMs I'm not sure there's a reliable way to look up the NAT gateway IP when no VM is running. (/var/db/dhcpd_leases
is there but only used for clients, and it's what tart ip
uses).
from packer-plugin-tart.
Do you have any news about this implementation ?
Thx.
from packer-plugin-tart.
Related Issues (20)
- Support for Remote Builds HOT 1
- Attaching additional disks during build HOT 3
- VNC password is not printed in debug log
- No cleanup after failure HOT 7
- Fails after VM start with "Failed to lock auxiliary storage" HOT 5
- PACKER_HTTP_ADDR is unset for shell provisioner
- Duplicated code between step_run and step_create_linux_vm HOT 3
- macOS 12 VM does not respond to VNC input HOT 3
- 2.7.0 crashes when trying to use via packer HOT 8
- Software Update doesn't work in VMs from tart packer plugin HOT 2
- Cannot extend the image with "Error: -69519: The target disk is too small for this operation" HOT 3
- Keyboard layout problem with boot_command HOT 2
- Occasional Timeout waiting for SSH HOT 14
- Document new http file serving example
- IPSW data source HOT 2
- Tart push post processor
- Plugin version 1.5.3 breaking on disk resize
- Allow running provisioners when recovery = true HOT 2
- Allow --resolver option when getting VM's IP HOT 1
- `{{ .HTTPIP }}` and `{{ .HTTPPort }}` are substituted as `<no value>` in `boot_command` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-plugin-tart.