changeset 14:7003cdf42392

can up vagrant machine in user environment (not root)
author taiki
date Mon, 11 Nov 2013 20:44:34 -1000
parents 96ae34f2f809
children f194adc597b6
files TODO ie-vagrant.c
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Mon Nov 11 12:02:40 2013 -1000
+++ b/TODO	Mon Nov 11 20:44:34 2013 -1000
@@ -1,3 +1,8 @@
 chown login users directory
 mount .vagrant.d
 network configration
+
+*export VAGRANT_HOME=/root/.vagrant.d/
+*export VAGRANT_DEFAULT_PROVIDER=kvm
+
+list box for user understand users box 
--- a/ie-vagrant.c	Mon Nov 11 12:02:40 2013 -1000
+++ b/ie-vagrant.c	Mon Nov 11 20:44:34 2013 -1000
@@ -29,6 +29,7 @@
 #define up_command "up"
 #define destroy_command "destroy"
 #define ssh_command "ssh"
+#define provider_arg "--provider=kvm"
 
 #define NEW(type)  ((type*)malloc(sizeof(type)))
 
@@ -69,6 +70,9 @@
   exit(1);
  }
  */
+    putenv("VAGRANT_HOME=/root/.vagrant.d/");
+    putenv("VAGRANT_DEFAULT_PROVIDER=kvm");
+
 
 /* Set uid, gid, euid and egid to root */
 
@@ -90,10 +94,10 @@
    perror("Execl:");
   }
  } else if ( strncmp(argv[1], "up", 2) == 0 ) {
-  if (execl(command, command, up_command, NULL) < 0) {
+  if (execl(command, command, up_command, provider_arg, NULL) < 0) {
    perror("Execl:");
   }
- } else if ( strncmp(argv[1], "ssh", 6) == 0 ) {
+ } else if ( strncmp(argv[1], "ssh", 3) == 0 ) {
      if (execl(command, command, ssh_command, NULL) < 0) {
        perror("Execl:");
      }