mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 01:29:07 +00:00
Allow linuxkit run vbox
to use multiple drives
VirtualBox hardware (like physical hardware) has only a limited number of IDE device on an IDE Controller. Unfortunately when using an additional drive, it was given the port value of 2, which doesn't exists in VirtualBox IDE controllers (as only 0 and 1 are permitted). This change makes use of the SATA Controller which can host much more drives, to hook the additional drives. Signed-off-by: Brice Figureau <brice@daysofwonder.com>
This commit is contained in:
parent
4968390a92
commit
f1f128c6dd
@ -171,6 +171,13 @@ func runVbox(args []string) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(disks) > 0 {
|
||||
_, out, err = manage(vboxmanage, "storagectl", name, "--name", "SATA", "--add", "sata")
|
||||
if err != nil {
|
||||
log.Fatalf("storagectl error: %v\n%s", err, out)
|
||||
}
|
||||
}
|
||||
|
||||
for i, d := range disks {
|
||||
id := strconv.Itoa(i)
|
||||
if d.Size != 0 && d.Format == "" {
|
||||
@ -188,7 +195,7 @@ func runVbox(args []string) {
|
||||
log.Fatalf("Cannot create disk: %v", err)
|
||||
}
|
||||
}
|
||||
_, out, err = manage(vboxmanage, "storageattach", name, "--storagectl", "IDE Controller", "--port", "2", "--device", id, "--type", "hdd", "--medium", d.Path)
|
||||
_, out, err = manage(vboxmanage, "storageattach", name, "--storagectl", "SATA", "--port", "0", "--device", id, "--type", "hdd", "--medium", d.Path)
|
||||
if err != nil {
|
||||
log.Fatalf("storageattach error: %v\n%s", err, out)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user