libvirtd:Could not find keytab file:/etc/libvirt/krb5.tab

在安装完KVM之后,virsh list --all正常,但是没有加载好虚拟机

查看系统日志/var/log/message 报下述错误:

libvirtd:Could not find keytab file:/etc/libvirt/krb5.tab

localhost kernel:lo: Disabled Privacy Extensiojs

在网上查找这种错误,发现很少有解决方案的,后面看了一下正常的KVM服务器,

重启libvirtd 之后 也报这个错误,但是虚拟机能用,感觉真正的原因不是这个。


然后还是再次核实xml文件,但是核实了几次之后,没有冲突,还是不能加载成功


最后问了碰到过此种情况的同事,得到了解决方案,综合网上的相关文件,具体解决如下

新的机器安装新的系统之后,要玩虚拟机的话要注意以下两点:

1、selinux功能要关闭
vi /etc/selinux/config
SELINUX=enfoceing
把其修改为:
SELINUX=disabled

2、BIOS 的VT功能要 改成 enabled
dell R410服务器如何虚拟化的功能
服务器要开虚拟机,如果要支持64位的就得开启虚拟化的功能,对于中国信息港常用的dell R410服务器如何虚拟化的功能呢?下面的设置可以帮助你开启虚拟化功能。
1。重新机器,在开机画面的右上角出现提示后,按F11 键(按下后显示Enter Bios Booting Manager,大约需要等待1分钟)进如BIOS设置。
2。进入BIOS选项后选择 第五项 “System Setup”项,按 Enter 键。
3。进入选项卡后,选择 第四项 “Process Settings”,按 Enter 键。
4。进入选项卡后,选择 第五项 “Virtualization Technology”, 按 “+”号键,将 “Disable”修改为“Enable”(并确认为Enable)。
5。按 Esc 键一次,弹出三个选项,选择第一项 “Save changs and exit”。
6。选择后机器自动重启。设置完成。
这样服务器就可以使用虚拟化功能了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
The `kinit` command is typically used to obtain and cache a Kerberos ticket-granting ticket (TGT) for a user or service principal. The `-kt` option specifies the path to the keytab file containing the service principal's key, and the principal name `kafka/tos_demo@DEMO.TDH` specifies the service principal to use for authentication. Here is an example Java code snippet that shows how to use the `javax.security.auth.Subject` and `javax.security.auth.login.LoginContext` classes to obtain a Kerberos TGT using a keytab file: ```java import javax.security.auth.Subject; import javax.security.auth.login.LoginContext; import javax.security.auth.login.LoginException; import java.io.File; public class KerberosAuthenticator { public static void main(String[] args) { String keytabPath = "/etc/keytabs/keytab"; String principalName = "kafka/tos_demo@DEMO.TDH"; // Set up the Kerberos login configuration System.setProperty("java.security.auth.login.config", "/etc/krb5.conf"); // Create a new subject to hold the Kerberos credentials Subject subject = new Subject(); // Create a new login context using the keytab and principal try { LoginContext loginContext = new LoginContext("KafkaClient", subject, null, new KeytabPrincipalAuthenticationModule(keytabPath, principalName)); loginContext.login(); } catch (LoginException e) { System.err.println("Failed to login: " + e.getMessage()); return; } // Print out the Kerberos ticket details System.out.println("Kerberos ticket granted to:"); subject.getPrincipals().forEach(System.out::println); } private static class KeytabPrincipalAuthenticationModule implements javax.security.auth.spi.LoginModule { private final String keytabPath; private final String principalName; private boolean succeeded = false; public KeytabPrincipalAuthenticationModule(String keytabPath, String principalName) { this.keytabPath = keytabPath; this.principalName = principalName; } @Override public void initialize(Subject subject, CallbackHandler callbackHandler, java.util.Map<String, ?> sharedState, java.util.Map<String, ?> options) { } @Override public boolean login() throws LoginException { // Create a new Kerberos login configuration based on the specified keytab and principal javax.security.auth.login.Configuration config = new javax.security.auth.login.AppConfigurationEntry[] { new javax.security.auth.login.AppConfigurationEntry( "com.sun.security.auth.module.Krb5LoginModule", javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, java.util.Map.of( "useKeyTab", "true", "keyTab", keytabPath, "principal", principalName, "storeKey", "true", "doNotPrompt", "true" ) ) }; // Attempt to authenticate using the keytab and principal javax.security.auth.login.LoginContext context = new javax.security.auth.login.LoginContext("", null, null, config); context.login(); // Add the Kerberos credentials to the subject succeeded = true; subject.getPrivateCredentials().add(context.getTicket()); return true; } @Override public boolean commit() throws LoginException { return succeeded; } @Override public boolean abort() throws LoginException { return false; } @Override public boolean logout() throws LoginException { subject.getPrivateCredentials().clear(); return true; } } } ``` This code defines a `K
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值