-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a network adapter based on guest os and hypervisor cpu architecture #260
Comments
Based on a cursory review of this issue, it's may be best to either: A. Remove the default selection and instead require this be selected from a list of supported options, which would be a breaking change. B. Automatically select, if not provided, from a map of supported operating systems and their default network adapter selection with a default fallback if by chance not listed. I'm leaning towards Option A. Ryan Johnson |
re: Option B, for example, maybe something like this: var networkAdapterMap map[string]string
var defaultAdapterType string
if runtime.GOARCH == "arm64" {
networkAdapterMap = map[string]string{
// Linux
"alma": "e1000e",
"centos": "e1000e",
"debian": "e1000e",
"fedora": "e1000e",
"photon": "vmxnet3",
"rhel": "e1000e",
"rocky": "e1000e",
"ubuntu": "e1000e",
"other": "e1000e",
// Windows
"windows": "vmxnet3",
}
defaultAdapterType = "e1000e"
} else {
networkAdapterMap = map[string]string{
// Linux
"alma": "vmxnet3",
"debian": "e1000",
"fedora": "vmxnet3",
"photon": "vmxnet3",
"rhel": "vmxnet3",
"rocky": "vmxnet3",
"ubuntu": "e1000",
"other": "vmxnet3",
// Windows
"windows": "vmxnet3",
}
defaultAdapterType = "vmxnet3"
}
adapterType := defaultAdapterType
guestOSTypeLower := strings.ToLower(config.GuestOSType)
for osType, adapter := range networkAdapterMap {
if strings.Contains(guestOSTypeLower, osType) {
adapterType = adapter
break
}
}
templateData.Network_Adapter = adapterType This would get rather tedious to manage with upstream changed though. Thoughts @lbajolet-hashicorp? |
@der-eismann After taking another look at this on both Intel and Apple Silicon, this also dictates the adapter used by default. For example, using Fedora 64-bit:
Therefore the selection must consider the CPU architecture. Lucas and I will need to determine if we should include the ability to select the appropriate network adapter type (similar to above) or remove the default and require an input. |
e1000e
network adapter and use as default
Updated the issue from "Mention |
Overview of the Issue
I thought I was going crazy. I tried to create a box with Fedora 40 and most settings on default, however it always had a kernel panic when booting. But when I create the VM via the GUI it worked fine. I tried to find the issue for ~30 mins until I saw that this plugin used the
e1000
network adapter as default while the GUI usede1000e
as default.IMHO
e1000e
should be the default because as VMware saysBoth OSes were released over 10 years ago and are not even supported anymore. Using a default that may not even work on modern systems is not good.
But if we don't want to change the default, at least mention
e1000e
in the docs.Reproduction Steps
Plugin and Packer version
packer 1.11.2 & plugin 1.1.0
Simplified Packer Buildfile
Operating system and Environment details
macOS 15.1 as host with VMware Fusion 13.6.1 and Fedora 40 as guest
Log Fragments and crash.log files
None
The text was updated successfully, but these errors were encountered: