           # TODO: this special case for koding should be generalized for any group.
           addVm {
             user
+            type    : 'user'
             target  : member
             sudo    : yes
             name    : "koding~#{member.profile.nickname}"


        nameFactory.next (err, uid)=>
          return callback err  if err
          vm = new JVM {
            name    : "#{name}#{uid}"
            users   : [{ id: user.getId(), sudo: yes, owner: yes }]
            groups  : [{ id: group.getId() }]
            usage
          }
          vm.save (err) =>

        type            : Boolean
        default         : no

  @createAliases = ({nickname, type, uid, groupSlug})->
    domain       = 'kd.io'
    if type is 'user'
      prefix = if uid > 0 then "vm#{uid}." else ""
      aliases = ["#{prefix}#{nickname}.#{groupSlug}.#{domain}"]
      if groupSlug is 'koding'
        aliases.push "#{prefix}#{nickname}.#{domain}"
    else if type is 'group'
      if uid is 0
        aliases = ["#{groupSlug}.#{domain}"
                 "shared.#{groupSlug}.#{domain}"]
      else
        aliases = ["shared-#{uid}.#{groupSlug}.#{domain}"]

    return aliases

  # TODO: this needs to be rethought in terms of bundles, as per the
  # discussion between Devrim, Chris T. and Badahir  C.T.
  @createVm = ({account, type, groupSlug, usage}, callback)->
    JGroup = require './group'
    JGroup.one {slug: groupSlug}, (err, group)=>
      return callback err  if err
      account.fetchUser (err, user)=>
        return callback err  if err
        name = "#{groupSlug}~"
        if type is 'user'
