Comments (7)
I don't see how this could work, as the host will not get to the point of obtaining and setting an IP address until it has fully booted.
It will get the IP if running macOS (even when running with--recovery
), but in the case of automated Linux installation I guess you're right. Is this what you're trying to do?
The reason we retrieve the VM's IP-address first is that it's the most reliable way to find out the bridge interface that the vmnet.framework
is using. And from that bridged interface it's easy to derive the gateway IP.
from packer-plugin-tart.
On a second thought, even if we skip the tart ip ...
part, how would a VM connect to the HTTP server running on host without obtaining the IP address for itself from the DHCP server first?
Packer plugin for Tart only officially supports shared (NAT) network, and that implies the DHCP usage by the guest.
from packer-plugin-tart.
Yes, automated Linux Ubuntu installation is what I'm trying to do. Had totally forgotten about macOS, makes so much more sense now. :/
The HTTP server's address is needed to pass as a parameter to the GRUB bootloader. It isn't actually used until networking is up and an IP address is obtained from DHCP.
It should be safe to assume that shared (NAT) network is being used, so I guess the question is how to reliably determine what interface is used for that. Could try and mirror what tart is doing with VZNetworkDeviceAttachment
and get the address through that somehow. Alternatively, a config option to set it manually would be fine for my purposes.
from packer-plugin-tart.
The HTTP server's address is needed to pass as a parameter to the GRUB bootloader. It isn't actually used until networking is up and an IP address is obtained from DHCP.
I've just tried running Ubuntu Server and preventing it from going past GRUB (by pressing Esc
) and it turns out that the Virtualization.Framework
didn't even create a bridge*
interface that we use to determine the {{ .HTTPIP }}
.
Anyway, I think you can already accomplish this:
Alternatively, a config option to set it manually would be fine for my purposes.
...by setting the http_bind_address
option to a value other than 0.0.0.0
in your Packer template for Tart plugin, see:
packer-plugin-tart/builder/tart/step_run.go
Lines 236 to 238 in eb96164
(yes, we currently bypass the guest IP/interface resolution logic if this option if not empty as opposed to not equal to 0.0.0.0
, but that's subject to change)
from packer-plugin-tart.
The HTTP server's address is needed to pass as a parameter to the GRUB bootloader. It isn't actually used until networking is up and an IP address is obtained from DHCP.
I've just tried running Ubuntu Server and preventing it from going past GRUB (by pressing
Esc
) and it turns out that theVirtualization.Framework
didn't even create abridge*
interface that we use to determine the{{ .HTTPIP }}
.
Good catch, I either didn't notice that or had something holding bridge100 open.
Anyway, I think you can already accomplish this:
Alternatively, a config option to set it manually would be fine for my purposes.
...by setting the
http_bind_address
option to a value other than0.0.0.0
in your Packer template for Tart plugin, see:packer-plugin-tart/builder/tart/step_run.go
Lines 236 to 238 in eb96164
(yes, we currently bypass the guest IP/interface resolution logic if this option if not empty as opposed to not equal to
0.0.0.0
, but that's subject to change)
That doesn't quite work for me, I had to move the commonsteps.HTTPServerFromHTTPConfig
before stepCreateLinuxVM
, I'm guessing because of the port number selection?
from packer-plugin-tart.
That doesn't quite work for me, I had to move the
commonsteps.HTTPServerFromHTTPConfig
beforestepCreateLinuxVM
, I'm guessing because of the port number selection?
Good catch! This should be fixed as a part of the new 1.3.0 release, the HTTP server is now started before the installation takes place.
from packer-plugin-tart.
Thanks so much, confirmed it is working with the workaround.
Longer term a better option might be to dynamically create an ISO or floppy similar to QEMU builder but this works for my manual invocations. Would require some sort of hack to get it working with CI though, I'd guess.
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 1
- 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.