how to setup OS type via Vagrant file?

451 views
Skip to first unread message

Alexey Melezhik

unread,
Nov 2, 2011, 5:11:10 AM11/2/11
to Vagrant
Hi!
I want to know if it possible to setup OS type via Vagrant file?
---
The history of this issue:
* I install gentoo64 VM on windows 7 32 bit host OS installed on 64
bit host machine
* `vagrant add` goes ok
* `vagrant up` waits in endless loop, because VirtualBox's assumption
for guest's OS type is gentoo, not gentoo46 and so VM does not launch
* when I setup OS type to gentoo64 via VirtualBox GUI vagrant up
succeed in launching virtual VM

Hedge Hog

unread,
Nov 2, 2011, 5:25:39 AM11/2/11
to vagra...@googlegroups.com
On Wed, Nov 2, 2011 at 8:11 PM, Alexey Melezhik <mele...@gmail.com> wrote:
> Hi!
> I want to know if it possible to setup OS type via Vagrant file?

Currently you can't. The OS type is queried over ssh from the running
VM and gentoo64 is not detected.
You'd need to change Vagrants' source to do this so I suppose you
could open a feature request.

There is some debate about what is the least fault prone -
configuration vs interrogation.

HTH

> ---
> The history of this issue:
> * I install gentoo64 VM on windows 7 32 bit host OS  installed on 64
> bit host machine
> * `vagrant add` goes ok
> * `vagrant up` waits in endless loop, because VirtualBox's assumption
> for guest's OS type is gentoo, not gentoo46 and so  VM does not launch
> * when I setup OS type to gentoo64 via VirtualBox GUI vagrant up
> succeed in launching virtual VM
>

--
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
  Archilochus, Greek poet (c. 680 BC – c. 645 BC)
http://hedgehogshiatus.com

Alexey Melezhik

unread,
Nov 2, 2011, 5:37:52 AM11/2/11
to Vagrant
OK, weird, if I compiled VM as gentoo64, why VirtualBox manager got
OS type response as gentoo? Or maybe the responce was correct
(gentoo64), but
VirtualBox manager forced to use gentoo 32 bit OS type because of
host os was 32 bit ?



On 2 ноя, 12:25, Hedge Hog <hedgehogshia...@gmail.com> wrote:

Hedge Hog

unread,
Nov 2, 2011, 4:50:44 PM11/2/11
to vagra...@googlegroups.com
On Wed, Nov 2, 2011 at 8:37 PM, Alexey Melezhik <mele...@gmail.com> wrote:
> OK, weird, if I compiled VM as gentoo64, why VirtualBox manager got
> OS type response as gentoo?

I think this should explain why:
https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/systems/linux.rb#L14

Again, I think if you want this addressed you'll need to open a issue?

HTH

Alexey Melezhik

unread,
Nov 18, 2011, 9:56:52 AM11/18/11
to Vagrant
OK, I did it - https://github.com/mitchellh/vagrant/issues/563

On 3 ноя, 00:50, Hedge Hog <hedgehogshia...@gmail.com> wrote:
> On Wed, Nov 2, 2011 at 8:37 PM, Alexey Melezhik <melez...@gmail.com> wrote:
> > OK, weird, if I compiled VM as gentoo64, why VirtualBox manager got
> >OStyperesponse as gentoo?
>
> I think this should explain why:https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/systems/...
>
>  Again, I think if you want this addressed you'll need to open a issue?
>
> HTH
>
>
>
>
>
> > Or maybe the responce was correct
> > (gentoo64), but
> > VirtualBox manager forced to use gentoo 32 bitOStypebecause of
> > hostoswas 32 bit ?
>
> > On 2 ноя, 12:25, Hedge Hog <hedgehogshia...@gmail.com> wrote:
> >> On Wed, Nov 2, 2011 at 8:11 PM, Alexey Melezhik <melez...@gmail.com> wrote:
> >> > Hi!
> >> > I want to know if it possible to setupOStypevia Vagrant file?
>
> >> Currently you can't.  TheOStypeis queried over ssh from the running
> >> VM and gentoo64 is not detected.
> >> You'd need to change Vagrants' source to do this so I suppose you
> >> could open a feature request.
>
> >> There is some debate about what is the least fault prone -
> >> configuration vs interrogation.
>
> >> HTH
>
> >> > ---
> >> > The history of this issue:
> >> > * I install gentoo64 VM on windows 7 32 bit hostOS installed on 64
> >> > bit host machine
> >> > * `vagrant add` goes ok
> >> > * `vagrant up` waits in endless loop, because VirtualBox's assumption
> >> > for guest'sOStypeis gentoo, not gentoo46 and so  VM does not launch
> >> > * when I setupOStypeto gentoo64 via VirtualBox GUI vagrant up

Mitchell Hashimoto

unread,
Dec 26, 2011, 1:14:28 PM12/26/11
to vagra...@googlegroups.com
Note that this is now easily possible with the new `config.vm.customize` in Vagrant 0.9.0 (not released yet), like so:

    config.vm.customize ["modifyvm", :id, "--ostype", "Gentoo_64"]

Best,
Mitchell

Alexey Melezhik

unread,
Feb 6, 2012, 9:56:41 AM2/6/12
to vagra...@googlegroups.com
great!
thank you!
Reply all
Reply to author
Forward
0 new messages