this maybe written easier:

```ruby
kvm = File.readlines('/proc/modules').any? { |line| line =~ /kvm_(intel|amd)/ }
unless kvm
  case File.read('/proc/cpuinfo')
  when /vmx/
    system("sudo /sbin/modprobe kvm-intel")
    kvm = true
  when /svm/
    system("sudo /sbin/modprobe kvm-amd")
    kvm = true
  else
    raise Errors::VagrantKVMError, "KVM is unavailable"     
  end
end
```