func vdiskmanager(dest string, size int) error {
	cmd := exec.Command(vdiskmanbin, "-c", "-t", "0", "-s", fmt.Sprintf("%dMB", size), "-a", "lsilogic", dest)
	if isMachineDebugEnabled() {
		cmd.Stdout = os.Stderr
		cmd.Stderr = os.Stderr
	}
	if stdout := cmd.Run(); stdout != nil {
		if ee, ok := stdout.(*exec.Error); ok && ee == exec.ErrNotFound {
			return ErrVMRUNNotFound
		}
	}
	return nil
}
Make a vmdk disk image with the given size (in MB).
package vmware
import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"io"
	"os"
	"os/exec"
	"strings"
	"time"
	"github.com/docker/machine/libmachine/log"
)
var (
	vmrunbin    = setVmwareCmd("vmrun")
	vdiskmanbin = setVmwareCmd("vmware-vdiskmanager")
)
var (
	ErrMachineExist    = errors.New("machine already exists")
	ErrMachineNotExist = errors.New("machine does not exist")
	ErrVMRUNNotFound   = errors.New("VMRUN not found")
)
func init() {
	SetUmask()
}
func isMachineDebugEnabled() bool {
	return os.Getenv("MACHINE_DEBUG") != ""
}
func vmrun(args ...string) (string, string, error) {
	cmd := exec.Command(vmrunbin, args...)
	return vmrun_cmd(cmd)
}
func vmrun_wait(timeout time.Duration, args ...string) (string, string, error) {
	ctx, cancel := context.WithTimeout(context.Background(), timeout)
	defer cancel()
	cmd := exec.CommandContext(ctx, vmrunbin, args...)
	return vmrun_cmd(cmd)
}
func vmrun_cmd(cmd *exec.Cmd) (string, string, error) {
	var stdout bytes.Buffer
	var stderr bytes.Buffer
	cmd.Stdout, cmd.Stderr = &stdout, &stderr
	if isMachineDebugEnabled() {
		cmd.Stdout = io.MultiWriter(os.Stderr, cmd.Stdout)
		cmd.Stderr = io.MultiWriter(os.Stderr, cmd.Stderr)
	}
	log.Debugf("executing: %v", strings.Join(cmd.Args, " "))
	err := cmd.Run()
	if err != nil {
		if ee, ok := err.(*exec.Error); ok && ee == exec.ErrNotFound {
			err = ErrVMRUNNotFound
		}
	}
	return stdout.String(), stderr.String(), err
}